Production ready starter template for Django Projects running on AWS Elastic Beanstalk
- Django 1.10.x
- Whitenoise for static files
- Configuration via environment variables using dj_database_url and dj_email_url
- Sane logging defaults
- Using pip-tools to pin requirements.in / requirements.txt
- MySQL or Postgres for database
- Optional support for Celery
- Optional support for TravisCI and CircleCI
- Optional support for Heroku and AWS Elastic Beanstalk
- Optional support for NewRelic and LogEntries
- Optional support for Django Rest Framework
Install cookiecutter globally (not in a virtualenv):
pip install cookiecutter --user
Run cookiecutter in your apps
directory:
cookiecutter https://github.com/hashedin/django-project-template -f
Cookiecutter creates a new directory for your app, cd
into that directory.
Create a virtualenv:
virtualenv .venv
source .venv/bin/activate
Upgrade pip
pip install --upgrade pip
Install requirements.txt
pip install -r requirements/local.txt
Commit the source code to git
git init .
git add -A
git commit -m "Initial Commit using django-project-template"
At this point, your Django project is ready.
Let's say you started your project, and now there are additional updates to django-project-template. Or, you had disabled celery, but now want to enable support. How do you incorporate those changes to your existing project, where you have already written some code?
- First, make sure commit all your changes to git. For safety, push it to a remote git server
- Then, re-run cookiecutter with the
-f
flag, perhaps with different settings. Note that you must be in theapps
directory and must type in the exact same repository and project name - otherwise cookiecutter will create new directories. - Use
git status
andgit diff
and carefully review the changes - If there are conflicts, manually merge them
- If satisfied, commit the changes. If not, revert and re-try with different cookiecutter settings