Deploying a Django project on Heroku
1. Modify settings.py
settings.py1-1. Debug
DEBUG = bool( os.environ.get('DJANGO_DEBUG', True))1-2. SECRET_KEY
import os
SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 'YOUR_SECRET_KEY')2. Install Heroku
Herokunpm install -g heroku3. Update the app for Heroku
Heroku3-1. Procfile
Procfileweb: gunicorn [YOUR_APP_NAME].wsgi --log-file -3-2. Install Gunicorn
Gunicorn3-3. Database configuration
3-4. Serving static files in production
3-5. Requirements
3-6. Runtime
4. Create and upload the website
4-1. Create the app
4-2. Push our app to the Heroku repository
4-3. Set up the database tables
4-4. Create superuser
4-5. Open your app
5. You are now live
Heroku Tips & Tricks
1. Disable collectstatic
3. Maintenance Mode
To enable maintenance mode
To disable maintenance mode
To check the current maintenance status of an app
4. Restart
5. Loaddata
PreviousDeploying a Django project on Microsoft AzureNextUsing AWS S3 to Store Static Assets on Heroku
Last updated