Django Base Site

The Django Base Site is a Django site that is built using the best Django practices and comes with all the common Django packages that you need to jumpstart your next project.


Documentation is available at


Install Requirements

Before setting up a new project make sure you have the following installed:

It's not a requirement, but it is recommended that you install Python using Pyenv with the virtualenvwrapper plugin.


Using the Install Script

Running the following script mostly does the same thing as manual quickstart method. The exception is that the install script has questions to customize your new project setup. Just run the following in your terminal to get started.

$ bash <(curl -s

Example output:

$ cd ~/Sites
$ bash <(curl -s

What is the project name slug [example]?
What directory do you want your project in [/Users/brento/Sites/example]?
Are going to use Docker Compose (Y/n)? Y
Are going to Heroku for deployment (Y/n)? Y


To start Docker Compose run:
$ cd /Users/brento/Sites/example
$ docker-compose up


.env <
$ curl -LOk && unzip master
$ mv django-base-site-master example
$ cd example
$ python -m venv .venv && source .venv/bin/activate
$ pip install -r ./requirements-dev.txt
$ export SECRET_KEY=$(python -c "import random; print(''.join(random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789%^&*(-_=+)') for i in range(50)))")
$ cat > .env <

Deploy on Heroku

$ git init
$ git add .
$ git commit
$ heroku create
$ heroku addons:create mailgun
$ heroku addons:create rediscloud
$ heroku buildpacks:add --index 1 heroku/nodejs
$ heroku buildpacks:add --index 2 heroku/python
$ function quote {
$     echo $(python3 -c "import urllib.parse, sys; print(urllib.parse.quote('${1}'))")
$ }
$ alias hg='heroku config:get'
$ heroku config:set READ_DOT_ENV_FILE=off \
SECRET_KEY=`python -c "import random; print(''.join(random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789%^&*(-_=+)') for i in range(50)))"` \
EMAIL_URL=smtp://$(quote $(hg MAILGUN_SMTP_LOGIN)):$(quote $(hg MAILGUN_SMTP_PASSWORD))@`hg MAILGUN_SMTP_SERVER`:`hg MAILGUN_SMTP_PORT`'/?ssl=True&_default_from_email='$(quote $(hg MAILGUN_SMTP_LOGIN)) \
$ git push --set-upstream heroku master
$ heroku run python migrate
$ heroku run python createsuperuser    
$ heroku open

Note: Before you'll be able to send email using Mailgun you'll have to setup your Heroku app on a custom domain under Heroku and Mailgun.

Download source code from Github

Download ZIP