$ pip install -r ./mezzanine/project_template/requirements.txt
(Note you must run pip install -r from this directory due to pip local directory dependency issues: https://github.com/pypa/pip/issues/328)
$ cp mezzanine/project_template/local_settings.py{.template,}
$ cp mezzanine/project_template/dev.db{.default,}
$ python setup.py develop
[Ed:
(Branch of provider that supports Django 1.7; Now included in requirements.txt.)]$ pip install git+https://github.com/glassresistor/django-oauth2-provider.git
python mezzanine/project_template/manage.py createsuperuser
$ python mezzanine/project_template/manage.py runserver
Whenever you alter the model run the following before committing:
$ python mezzanine/project_template/manage.py makemigrations
Then to apply those migrations to your local database:
$ python mezzanine/project_template/manage.py migrate
See [Django Docs]($ python mezzanine/project_template/manage.py makemigrations) for more info.
Our current configuration roughly follows the uwsgi tutorial for Django and nginx.
- nginx
- via
/etc/nginx/conf.d/default.conf
- socket connection to uwsgi
- via
- uwsgi
- manage with emperor (loaded via
/etc/rc.local
)
- manage with emperor (loaded via
- virtualenv
- debian (7/wheezy)
Logs are in the usual places for Debian (e.g. /var/log/nginx/error.log
) and /[deploy_user]/logs/ - check timestamps if unsure. Ripe for improvement.
Do not rely on this guide.
- cert access to production's deploy user
- access to repo
- USE THE BUDDY SYSTEM
- REVIEW THE FULL CHANGE/COMMIT LOG
- TEST AGAIN (if test and production diverge, you are not testing)
- SCHEDULE THE DEPLOY
- ssh to production using deploy credential
tmux a -t deploy
ortmux new -s deploy
; don't let a disconnect get you down 0. if new tmux session:/bin/bash
to make your life easier (do not change the default shell) 0. if new tmux session:cd venv/mezzanine/
git fetch && git status
and check carefully for weirdness, branch, etc.git pull origin [branchname]
mezzanine/project_template/manage.py migrate
touch mezzanine/project_template/uwsgi.ini