- starter project
- custom registration
- cerulean boostrap template - http://bootswatch.com/cerulean/
I use this template for most starter projects.
If you have git and Python installed, you can run the following commands to setup this project on your computer and run it to see how it works.
$ git clone https://github.com/mjhea0/django-1.5-template.git
$ cd django-1.5-template
$ virtualenv --no-site-packages env
$ source env/bin/activate
$ pip install -r requirements.txt
$ cd django-1.5-template
$ python manage.py syncdb
$ python manage.py runserver
-
Install the django-toolbelt:
$ pip install django-toolbelt
-
Add the Procfile:
$ touch Procfile
-
Insert the following code into the Procfile:
web: gunicorndjango-15-template.wsgi
-
Test locally:
$ foreman start
-
Udate the requirements:
$ pip freeze > requirements.txt
-
Append the following code to settings.py
# Parse database configuration from $DATABASE_URL import dj_database_url DATABASES['default'] = dj_database_url.config() # Honor the 'X-Forwarded-Proto' header for request.is_secure() SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') # Allow all host headers ALLOWED_HOSTS = ['*']
-
Update wsgi.py:
import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django-15-template.settings") from django.core.wsgi import get_wsgi_application from dj_static import Cling application = Cling(get_wsgi_application())
-
Initiate a local Git repo:
$ git init $ git add . $ git commit -m "first commit"
-
PUSH to Heroku
$ heroku create $ git push heroku master
-
Add postgres:
$ heroku addons:add heroku-postgresql:dev $ heroku pg:promote [NAME OF DATABASE]
-
Sync the DB:
$ heroku run python manage.py syncdb
-
Test:
$ heroku open