Skip to content

Commit 80e34a8

Browse files
committed
Merge pull request #361 from hjwp/postworkshop-improvements
PythonAnywhere deploy: some tweaks and improvements based on experiences from first workshop
2 parents 5523636 + a72beeb commit 80e34a8

4 files changed

Lines changed: 27 additions & 16 deletions

File tree

en/deploy/README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ Just like you did on your own computer, you can create a virtualenv on PythonAny
184184
Successfully installed django-1.8 whitenoise-1.0.6
185185

186186

187+
> **Note** The `pip install` step can take a couple of minutes. Patience, patience! But if it takes more than 5 minutes, something is wrong. Ask your coach.
188+
187189
<!--TODO: think about using requirements.txt instead of pip install.-->
188190

189191

@@ -193,7 +195,7 @@ Were you wondering what "whitenoise" thing was? It's a tool for serve so-called
193195

194196
We'll find out a bit more about static files later in the tutorial, when we edit the CSS for our site.
195197

196-
For now we just need to run an extra command called "collectstatic", on the server. It tells Django to gather up all the static files it needs on the server. Mostly, these are the static files that make the admin site look pretty at the moment.
198+
For now we just need to run an extra command called `collectstatic`, on the server. It tells Django to gather up all the static files it needs on the server. Mostly, these are the static files that make the admin site look pretty at the moment.
197199

198200

199201
20:20 ~ $ python manage.py collectstatic
@@ -210,11 +212,11 @@ For now we just need to run an extra command called "collectstatic", on the serv
210212

211213
Type "yes", and away it goes! Don't you love making computers print out pages and pages of impenetrable text? I always make little noises to accompany it. Brp, brp brp...
212214

213-
Copying '/home/edith/.virtualenvs/mvenv/lib/python3.4/site-packages/django/contrib/admin/static/admin/js/actions.min.js'
214-
Copying '/home/edith/.virtualenvs/mvenv/lib/python3.4/site-packages/django/contrib/admin/static/admin/js/inlines.min.js'
215+
Copying '/home/edith/my-first-blog/mvenv/lib/python3.4/site-packages/django/contrib/admin/static/admin/js/actions.min.js'
216+
Copying '/home/edith/my-first-blog/mvenv/lib/python3.4/site-packages/django/contrib/admin/static/admin/js/inlines.min.js'
215217
[...]
216-
Copying '/home/edith/.virtualenvs/mvenv/lib/python3.4/site-packages/django/contrib/admin/static/admin/css/changelists.css'
217-
Copying '/home/edith/.virtualenvs/mvenv/lib/python3.4/site-packages/django/contrib/admin/static/admin/css/base.css'
218+
Copying '/home/edith/my-first-blog/mvenv/lib/python3.4/site-packages/django/contrib/admin/static/admin/css/changelists.css'
219+
Copying '/home/edith/my-first-blog/mvenv/lib/python3.4/site-packages/django/contrib/admin/static/admin/css/base.css'
218220
62 static files copied to '/home/edith/my-first-blog/static'.
219221

220222

@@ -291,13 +293,19 @@ We're all done! Hit the big green **Reload** button and you'll be able to go vi
291293

292294
## Debugging tips
293295

294-
If you see an error when you try to visit your site, the first place to look for some debugging info is in your **error log** -- you'll find a link to this on the PythonAnywhere web tab. See if there are any error messages in there. The most recent ones are at the bottom. Common problems include
296+
If you see an error when you try to visit your site, the first place to look for some debugging info is in your **error log** -- you'll find a link to this on the PythonAnywhere [Web tab](https://www.pythonanywhere.com/web_app_setup/). See if there are any error messages in there; the most recent ones are at the bottom. Common problems include:
297+
298+
- Forgetting one of the steps we did in the console: creating the virtualenv, activating it, installing Django into it, running collectstatic, migrating the database
299+
300+
- Making a mistake in the virtualenv path on the Web tab -- there will usually be a little red error message on there, if there is a problem
301+
302+
- Making a mistake in the WSGI configuration file -- did you get the path to your my-first-blog folder right?
303+
304+
- Did you pick the same version of Python for your virtualenv as you did for your web app? Both should be 3.4.
295305

296-
- forgetting one of the steps we did in the console: creating the virtualenv, activating it, installing Django into it, running collectstatic, initialising the database
297-
- making a mistake in the virtualenv path on the web tab -- there will usually be a little red error message on there, if there is a problem
298-
- making a mistake in the WSGI configuration file -- did you get the path to your my-first-blog folder right?
306+
- There are some [general debugging tips on the PythonAnywhere wiki](https://www.pythonanywhere.com/wiki/DebuggingImportError)
299307

300-
Your coach is here to help!
308+
And remember, your coach is here to help!
301309

302310

303311
# You are live!

en/django_forms/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,10 @@ $ git push
347347

348348
```
349349
$ cd my-first-blog
350-
$ git pull
350+
$ source myvenv/bin/activate
351+
(myvenv)$ git pull
351352
[...]
352-
$ python manage.py collectstatic
353+
(myvenv)$ python manage.py collectstatic
353354
[...]
354355
```
355356

en/extend_your_application/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@ $ git push
154154

155155
```
156156
$ cd my-first-blog
157-
$ git pull
157+
$ source myvenv/bin/activate
158+
(myvenv)$ git pull
158159
[...]
159-
$ python manage.py collectstatic
160+
(myvenv)$ python manage.py collectstatic
160161
[...]
161162
```
162163

en/html/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,10 @@ Once we've done that, we upload (push) our changes up to PythonAnywhere:
179179

180180
```
181181
$ cd ~/my-first-blog
182-
$ git pull
182+
$ source myvenv/bin/activate
183+
(myvenv)$ git pull
183184
[...]
184-
$ python manage.py collectstatic
185+
(myvenv)$ python manage.py collectstatic
185186
[...]
186187
```
187188

0 commit comments

Comments
 (0)