forked from lsblakk/pystar
/
dep-django.html
230 lines (202 loc) · 11.2 KB
/
dep-django.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>django — PyStar: Programming Workshops for Women and Their Friends</title>
<link rel="stylesheet" href="../_static/agogo.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://tablesorter.googlecode.com/svn/trunk/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="../_static/js/third_party/jquery.twitter.mentions/jquery.twitter.mentions.js"></script>
<script type="text/javascript" src="../_static/js/pystar.js"></script>
<script type="text/javascript" src="../_static/js/third_party/jquery.socialbutton-1.7.1.js"></script>
<link rel="shortcut icon" href="../_static/pystar_flaming_32_150px.ico"/>
<link rel="author" title="About these documents" href="../about.html" />
<link rel="top" title="PyStar: Programming Workshops for Women and Their Friends" href="../index.html" />
<link rel="up" title="Setup Your Machine!" href="../setup_machine.html" />
<link rel="next" title="Schedule" href="../schedule.html" />
<link rel="prev" title="pip" href="dep-pip.html" />
<link rel="stylesheet" href="../_static/pystar.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/twitter-mentions.css" type="text/css" />
<link rel="stylesheet" href="../_static/tablesorter_blue_skin/style.css" type="text/css" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-27597337-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div class="header-wrapper">
<div class="header">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/pystar_flaming_160_150px.png" alt="Logo"/>
</a></p>
<h1><a href="../index.html">PyStar: Programming Workshops for Women and Their Friends</a></h1>
<div class="rel">
<a href="dep-pip.html" title="pip"
accesskey="P">previous</a> |
<a href="../schedule.html" title="Schedule"
accesskey="N">next</a>
</div>
</div>
</div>
<div style="position: absolute; top:0px; right:0px">
<a href="https://github.com/pystar/pystar"><img src="../_static/img/forkme_right_darkblue_121621.png" /></a>
</div>
<div class="content-wrapper">
<div class="content">
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="django">
<span id="dep-django-label"></span><h1>django<a class="headerlink" href="#django" title="Permalink to this headline">¶</a></h1>
<div class="section" id="what-is-django">
<span id="dep-django-what-label"></span><h2>What is <tt class="docutils literal"><span class="pre">django</span></tt>?<a class="headerlink" href="#what-is-django" title="Permalink to this headline">¶</a></h2>
<p>Django is the most-popular web-development framework written in Python.</p>
</div>
<div class="section" id="why-do-i-need-django">
<span id="dep-django-why-label"></span><h2>Why do I need <tt class="docutils literal"><span class="pre">django</span></tt>?<a class="headerlink" href="#why-do-i-need-django" title="Permalink to this headline">¶</a></h2>
<p>For building our voting application!</p>
</div>
<div class="section" id="get-django">
<span id="dep-django-how-label"></span><h2>Get <tt class="docutils literal"><span class="pre">django</span></tt>!<a class="headerlink" href="#get-django" title="Permalink to this headline">¶</a></h2>
<p>We don’t want to install django system wide, but rather in our local
virtualenv. We’re also going to install <tt class="docutils literal"><span class="pre">south</span></tt>, a Django helper application which will make it easier for us to go back and edit our Django app later.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>pip install django
<span class="nv">$ </span>pip install south
</pre></div>
</div>
</div>
<div class="section" id="verify-it-works">
<span id="django-verify-label"></span><h2>Verify It Works!<a class="headerlink" href="#verify-it-works" title="Permalink to this headline">¶</a></h2>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>python
>>> import django
</pre></div>
</div>
<p>To quit the python prompt do:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="nb">exit</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="section" id="verify-you-can-create-a-new-django-app">
<span id="django-app-create-label"></span><h2>Verify you can create a new Django app<a class="headerlink" href="#verify-you-can-create-a-new-django-app" title="Permalink to this headline">¶</a></h2>
<p>Create a folder on the desktop called <tt class="docutils literal"><span class="pre">django_projects</span></tt>
Open a new Terminal window and type the following:</p>
<div class="highlight-bash"><div class="highlight"><pre>mkdir django_projects
<span class="nb">cd </span>django_projects
django-admin.py startproject myproject
</pre></div>
</div>
<p>Both commands should provide no output.
Once that’s finished, type the following in the Terminal window:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nb">cd </span>myproject
python manage.py runserver
</pre></div>
</div>
<p>Output should look like this:</p>
<div class="highlight-python"><pre>Validating models...
0 errors found
Django version 1.2.5, using settings 'myproject.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.</pre>
</div>
<p>In your browser, go to <a class="reference external" href="http://127.0.0.1:8000/">http://127.0.0.1:8000/</a></p>
<p>In your Terminal window you should see something like:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="o">[</span>19/Mar/2011 19:19:26<span class="o">]</span> <span class="s2">"GET / HTTP/1.1"</span> 200 2057
</pre></div>
</div>
<p>Back in the Terminal window where you ran python manage.py runserver,
type control-c to kill the server.</p>
<p>Congratulations, you have run your first Django app!</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sidebar">
<h3>Table Of Contents</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../about.html">About</a></li>
<li class="toctree-l1"><a class="reference internal" href="../for_organizers.html">Advice for Organizers</a></li>
<li class="toctree-l1"><a class="reference internal" href="../safer_space.html">Safer Space</a></li>
<li class="toctree-l1"><a class="reference internal" href="../for_learners.html">Advice for Learners</a></li>
<li class="toctree-l1"><a class="reference internal" href="../for_guides.html">Advice for Guides</a></li>
<li class="toctree-l1"><a class="reference internal" href="../badges/index.html">Badges</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../setup_machine.html">Setup Your Machine!</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../badges/badge_setup_linux.html">Setup Linux</a></li>
<li class="toctree-l2"><a class="reference internal" href="../badges/badge_setup_mac.html">Setup Mac</a></li>
<li class="toctree-l2"><a class="reference internal" href="../badges/badge_setup_win.html">Setup Windows</a></li>
<li class="toctree-l2"><a class="reference internal" href="dep-python.html">python</a></li>
<li class="toctree-l2"><a class="reference internal" href="dep-gedit.html">gedit</a></li>
<li class="toctree-l2"><a class="reference internal" href="dep-git.html">git, sshkeys, github</a></li>
<li class="toctree-l2"><a class="reference internal" href="dep-virtualenv.html">virtualenv</a></li>
<li class="toctree-l2"><a class="reference internal" href="dep-pip.html">pip</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="">django</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../schedule.html">Schedule</a></li>
<li class="toctree-l1"><a class="reference internal" href="../survey_pre_google.html">Pre-Workshop Assessment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../survey_post_google.html">Post-Workshop Assessment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../previous_pystars.html">Previous Pystars</a></li>
<li class="toctree-l1"><a class="reference internal" href="../sponsors.html">Sponsors</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes_and_tools.html">Notes and Tools</a></li>
</ul>
<h3 style="margin-top: 1.5em;">Twitter</h3>
<div id='twitter-area'>[twitter]</div>
<h3 style="margin-top: 1.5em;">Search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<div class="clearer"></div>
</div>
</div>
<div class="footer-wrapper">
<div class="footer">
<div class="left">
<a href="dep-pip.html" title="pip"
>previous</a> |
<a href="../schedule.html" title="Schedule"
>next</a>
<br/>
<a href="../_sources/dependencies/dep-django.txt"
rel="nofollow">Show Source</a>
</div>
<div class="right">
<div class="footer">
Last updated on Dec 08, 2011.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
</div>
</div>
<div class="clearer"></div>
</div>
</div>
</body>
</html>