The easiest way: Django App Deployment on Heroku

heroku login 
git init
git add . 
git commit -m “any comment”
heroku create heroku_app_name
heroku git:remote -a heroku_app_name
pip install waitress
waitress-serve — port=8000 inner_project_folder_name.wsgi:application
ALLOWED_HOSTS = [‘*’]
web: waitress-serve — port=8000 inner_project_folder_name.wsgi:application
heroku local
DEBUG = False
ALLOWED_HOSTS = [‘heroku_app_name.herokuapp.com’, ‘localhost’]
import os
SECRET_KEY = os.environ[‘SECRET_KEY’]
STATIC_ROOT = BASE_DIR / “static”
pip install whitenoise
MIDDLEWARE = [
# ‘django.middleware.security.SecurityMiddleware’,
‘whitenoise.middleware.WhiteNoiseMiddleware’,
# …
]
pip freeze > requirements.txt
git add .
git commit -m “any comment”
git push heroku master
heroku config:set DISABLE_COLLECTSTATIC=1 

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store