I have a Django app I want to deploy to Heroku. I tried to follow the instructions here: https://devcenter.heroku.com/articles/getting-started-with-django which tells you to
Before deploying, make the following four changes to your project so it’s ready to deploy online with Heroku:
gunicorn as your web-server.
( Since, you are using conda environment gunicorn is not currently available at any conda channels to install. So, use pip install gunicorn ) requirements.txt file to your project's base directory and inside it add the modules names along with it versions or simply copy the contents that you get after you run pip freeze command. Make a new file: Procfile & inside it add the following:
web: gunicorn [Project_name].wsgi --log-file -
(Here [Project_name] is your own project's directory name)
This says to use your existing [Project_name].wsgi file but with gunicorn.
Make just a single change to settings.py file:
ALLOWED_HOSTS = ['*']
( The wildcard Asterisk * means all domains are acceptable to keep things simple. )
Now finally you can deploy using these steps:
Create a new app on Heroku:
On CLI type heroku create
(Heroku will create a random name for your app; [your_app_name])
Add a git remote “hook” for Heroku:
heroku git:remote -a [your_app_name]
Ignore static files:
heroku config:set DISABLE_COLLECTSTATIC=1
Push our code to Heroku:
git push heroku master
Finally, make your Heroku app live:
heroku ps:scale web=1
( Here, web=1 for basic Heroku services )
To open your app: heroku open
Your app should now be live on Heroku.