Production ready starter template for Django Projects running on AWS Elastic Beanstalk or Heroku
- Latest Django 1.11.1
- Whitenoise for static files
- Configuration via environment variables using dj_database_url and dj_email_url
- Sane logging defaults
- 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
brew install cookiecutter
sudo apt-get install cookiecutter
Run cookiecutter in your
cookiecutter https://github.com/hashedin/django-project-template -f
Cookiecutter will create a new directory for your app,
cd into that directory.
Create a virtualenv with Python 3:
virtualenv -p python3 .venv source .venv/bin/activate
pip3 install --upgrade pip
pip3 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.
Re-running Cookie Cutter
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
-fflag, perhaps with different settings. Note that you must be in the
appsdirectory and must type in the exact same repository and project name - otherwise cookiecutter will create new directories.
git diffand 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