-
Notifications
You must be signed in to change notification settings - Fork 8
Django 2.0 Heroku
Dan Loewenherz edited this page Aug 18, 2018
·
2 revisions
Includes a requirements.txt with libraries that promote Django best practices, such as:
- Django storages, for support with many file storage backends.
- Django Devserver, for a great replacement to the built in Django runserver command.
- Django Debug Toolbar, for an easy to use toolbar with fantastic profiling information.
- Statictastic, for an easy way to sync static media to your storage backends.
-
Create the project on Heroku or connect it to an existing project.
heroku git:remote -a HEROKU-PROJECT-NAME
Or:
heroku create
-
Add the PostgreSQL addon.
heroku addons:create heroku-postgresql
-
Specify that the project uses the Python buildpack.
heroku buildpacks:set heroku/python
-
Set the environment variables.
heroku config:set APP_ENVIRONMENT=production heroku config:set AWS_ACCESS_KEY_ID=XXX heroku config:set AWS_SECRET_ACCESS_KEY=XXX heroku config:set AWS_STORAGE_BUCKET_NAME=XXX heroku config:set DISABLE_COLLECTSTATIC=1
-
Create the base
User
migration../manage.py makemigrations app
To start a new Django project called project_name
, run the following.
django-admin.py startproject -e md,ngx,ini,Procfile --template=https://github.com/lionheart/django-template/archive/django-2.0-heroku.zip project_name