UPDATE: This is probably out of date now. I've written an updated guide here
This is a fork of Seedstars' brilliant django-react-redux-jwt-base boilerplate project. It is adapted to be deployed on Heroku. There's a couple other changes I've made based on my preferences. I didn't make a formal fork because it's different enough to merit its own repo.
Here are the major changes:
- Added
Procfile
- Added
runtime.txt
- Added another target to
package.json
calledpostinstall
. Heroku runs this after deployment. - Heroku expects a
requirements.txt
in the root. I've copied overpy-requirements/base.txt
to it. - The local environment now uses a postgres instance rather than SQLite. See
dev.py
in the settings folder to see all credentials. - Semantic-UI is included. For an example, see the
ProtectedView
. I've decided to check a compiled version into thestatic/
folder so user beware. Long term, this should be replaced with a library of React components for Semantic. - Sentry logging is turned off on production and replaced with standard local logging.
- Not using
scripts/static_validate_backend.sh
. Just using pep8 through vim. - Stripped out the UI components so it looks ugly on first load.
Make sure to setup postgres on Heroku and have your buildpacks in order:
heroku buildpacks:add --index 1 heroku/nodejs
heroku buildpacks:add --index 2 heroku/python
And set the DJANGO_SETTINGS_MODULE
environment variable:
heroku config:set DJANGO_SETTINGS_MODULE=djangoreactredux.settings.prod
Hope it helps.
For some reason, Heroku doesn't like the node & npm versions set on the first commit. The postinstall
command will fail. So on the first commit, comment those out. Put them back in (and make sure they match the versions on your dev environment) from the second commit onwards.
s3 cloudfront