Skip to content

Commit

Permalink
Extended example/README.md
Browse files Browse the repository at this point in the history
    - add codespeed to the PYTHONPATH
    - load fixture
    - hint for gunicorn missing virtualenv
  • Loading branch information
a8 committed Jul 4, 2011
1 parent ec0dbf5 commit 293d6b2
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions example/README.md
Expand Up @@ -22,21 +22,28 @@ It is assumed you are in the root directory of the Codespeed software.
1. Install the Python pip module
`which pip >/dev/null || easy_install pip`
(You might be required to use sudo)
2. Copy the example directory to your project. (Prevents updates on
2. You *must* copy the example directory to your project. (Prevents updates on
git tracked files in the future.) Let's call it speedcenter
`cp -r example speedcenter`
3. Enter that directory
`cd speedcenter`
4. Install Django, Codespeed and other dependencies using pip
`pip install -r requirements.txt`
(You might be required to use sudo)
5. Initialise the Django Database
5. Add codespeed to your Python path
Either
`export PYTHONPATH=../:$PYTHONPATH`
or
`ln -s ../codespeed .`
6. Initialise the Django Database
`python manage.py syncdb`
(Yes, add a superuser.)
python manage.py migrate
6. Finally, start the Django development server.
`python manage.py migrate`
Optionally, you may want to load the fixture data for a try
`python manage.py loaddata ../codespeed/fixtures/testdata.json`
7. Finally, start the Django development server.
`python manage.py runserver`
7. Enjoy.
8. Enjoy.
`python -m webbrowser -n http://localhost:8000`

## Installing for production
Expand All @@ -47,8 +54,8 @@ not hesitate to consult a search engine to tune your set-up.
### NGINX + GUNICORN: Easy as manage.py runserver
Assumed you have a [Debian](http://www.debian.org) like system.

1. Follow the steps from the development server set-up
2. Install nginx and gunicorn
1. Follow the steps from the development server set-up up to the the 6th step (database init).
2. Install [nginx](http://nginx.net/) and [gunicorn](http://gunicorn.org/)
`sudo apt-get install nginx gunicorn`
3. Tune /etc/nginx/sites-enabled/default to match
deploy/nginx.default-site.conf
Expand All @@ -60,6 +67,13 @@ Assumed you have a [Debian](http://www.debian.org) like system.
5. Prepare static files
`cd /path/to/speedcenter/`
`python ./manage.py collectstatic`
6. Add 'gunicorn' to your INSTALLED_APPS in settings.py
INSTALLED_APPS = (
'django.contrib.auth',
[...]
'south',
'gunicorn'
)
6. Run speedcenter by
`python ./manage.py run_gunicorn`
7. Check your new speedcenter site! Great! But wait, who runs gunicorn after the
Expand All @@ -73,6 +87,9 @@ Assumed you have a [Debian](http://www.debian.org) like system.
5. `supervisorctl update`
6. `supervisorctl status`
speedcenter RUNNING pid 2036, uptime 0:00:05
8. Warning: You may find another way to run gunicorn using `gunicorn_django`. That might
have a shebang of `#!/usr/bin/python` bypassing your virtualenv. Run it out of your
virtualenv by `python $(which gunicorn_django)`

### Good old Apache + mod_wsgi
If you don't like suprises and are not into experimenting go with the old work horse.
Expand Down

0 comments on commit 293d6b2

Please sign in to comment.