Deploying a django project on Heroku
steps to deplay a django project on heroku
1. import django_heroku (settings.py)
=> ALLOWED_HOSTS = ['127.0.0.1', '.herokuapp.com']
2. django_heroku.settings(locals()) (at the end of settings.py)
open your repository with Git Bash and run the following commands
3 pip freeze
4. pip freeze > requiremets.txt
5. creating Procfile with no extension (web: gunicorn <Project Name>.wsgi
6. run the commands
$ heroku login
$ git status
$ git add -A .
$ git commit -m "Message"
$heroku config:set DEBUG_COLLECTSTATIC=1
$heroku config:set DISABLE_COLLECTSTATIC=1
$heroku create -a <app name> ( if you wanna create new app)
heroku git:remote -a example-appr
$ git push heroku main ($ git push --force heroku main)
summary of commands from step 6:
https://devcenter.heroku.com/articles/git
Comments
Post a Comment