Django-Gunicorn, Snapped! Is an awesome new way to deploy your Django applications.
This snap delivers two processes:
- Gunicorn
- Nginx
Nginx listens on the snap's private /tmp filesystem at /tmp/django-gunicorn.sock
and is not visible to any other application or filesystem.
$ sudo snapcraft
$ sudo snap install django-gunicorn_0.1_amd64.snap --classic --dangerous
After building and installing the snap, visit
http://<your-ip-address>:5000
and view your Django application running in the snap!
Follow the steps below to setup a development environment.
- Create a virturalenv
python3 -m venv .venv
- Activate the venv
source .venv/bin/activate
- Install dependancies + test deps
pip install -r requirements.txt
pip install -r test-requirements.txt
- Run dev server
./manage.py runserver <host>:<port>
- Make snap strictly confined instead of classic
- Follow snapping best practices more closely by removing unneeded files and dirs (I'm sure there are other things I've overlooked)
- Add wrapper for manage.py to facilitate lifecycle more easily via charm
- Snap nginx separate from django-gunicorn snap (this will make builds faster and a bunch of good/cool things possible)
- Possibily template this demo (ex
./create mynewproj
will create the directory layout and files with the correct names)
- James Beedy (c) 2017 [email protected]
- AGPLv3 (see
copyright
)