-
freenodejobs/
This directory contians the Django project for this. It makes use of nested applications to organise the code.
-
freenodejobs/settings/
This directory contains the distributable Django settings for the project. The majority of the settings are stored in
defaults/*.py
and then "roles" are applied on top of this to override them when running outside of production and/or in tests controlled by therole.py
file that is overridden by the deployment. For local settings to your personal environment. you can add them to thefreenodejobs/settings/custom.py
file. -
media/
This directory contains assets that will are served publically via Nginx. They are managed by the Django staticfiles mechanism with the addition of the
django-staticfiles-dotd
third-party application to automatically concatenatefoo.ext.d
directories (into afoo.ext
file) and to render.scss
(Sass) files via theSTATICFILES_DOTD_RENDER_PIPELINE
setting. -
templates/
Contains regular Django templates. organised by application.
-
data/
This directory contains files that should be available to the Django project but not available via the web server (c.f.
static/
). -
config/
Contains Ansible roles, etc. for deploying the site. Called via
.travis.yml
, the main script is atdeploy/entry
which expects aANSIBLE_VAULT_PASSWORD
variable to be exported to the environment (set in the private Travis CI settings, but also available in Lastpass) in order to decrypt private data such as SSH keys, AWS keys, Django'sSECRET_KEY
, etc. -
debian/
As part of the deployment pipeline, a Debian
.deb
package is built using dh-virtualenv to ensure a tidy installation on the target server. The Gunicorn WSGI server is started via the systemddebian/freenodejobs.freenodejobs-gunicorn.service
file.
-
Create PostgreSQL user with an id matching your UNIX username:
$ sudo -u postgres createuser $(whoami) -SDR
-
Create a database owned by this user:
$ sudo -u postgres createdb -E UTF-8 -O $(whoami) freenodejobs
-
Check we can connect to this database:
$ /usr/bin/psql freenodejobs
-
Create empty tables, etc.:
$ ./manage.py migrate
./setup.py test