Django project template that we use at Thorgate.
Best suited for single page web applications.
See also the default and Bootstrap 4 variants.
(note that the primary repo is in Gitlab, with mirror in Github)
3.0 brings support for env based settings.
- Upgrade template
- Move all required bits to new
app
directory - Test that everything is still working
- Commit changes
- Servers
- Update Django to new settings
- Convert
<root>/<project>/settings/local.py
to<root>/<project>/django.env
- Or remove
DJANGO_PRODUCTION_MODE
andDJANGO_SETTINGS_MODULE
env reference fromDockerfile-django.production
- Convert
- Copy
<root>/app/env/node.env.example
to<root>/app/env/node.env
- Update Node settings in
<root>/app/env/node.env
SITE_URL
DJANGO_SITE_URL
ALLOWED_HOSTS
RAVEN_PUBLIC_DSN
RAVEN_BACKEND_DSN
- Update Node settings in
- Update Django to new settings
-
Django-based storage API backend (accessible from port
3000
for local development)- Django 1.11 (because it's LTS)
- Separate settings for different environments (local/staging/production)
- Python 3.6+
-
Frontend app with JavaScript (ES2015), React, Koa, and Sass (accessible from port
8000
for local development) -
Batteries
To use this template, first ensure that you have
Cookiecutter available.
You should probably create additional python3 virtual environment for cookiecutter, activate it
and then install following packages by running following command:
pip install cookiecutter cookiecutter_repo_extensions fqdn
Then just execute:
cookiecutter dir/to/django-project-template/
It will ask you a few questions, e.g. project's name.
After generation completes, search for any TODOs in the code and make appropriate changes where needed.
See README.md in the generated project for instructions on how to set up your development environment.
First ensure you have a python3 interpreter with cookiecutter
installed.
To upgrade an existing project, change the current working directory to the root of the project you want to upgrade. i.e. cd project-to-upgrade
. Ensure your are not in the template
branch.
Then run python ~/path/to/django-project-template/upgrade-template.py
This will make a commit to the branch template
in your project with the updates to the project template. Then merge the template
branch.