Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems when deploying to production using Heroku #231

Open
gusbakker opened this issue Apr 22, 2020 · 0 comments
Open

Problems when deploying to production using Heroku #231

gusbakker opened this issue Apr 22, 2020 · 0 comments

Comments

@gusbakker
Copy link

gusbakker commented Apr 22, 2020

For anyone here that could not successfully deployed to production using Heroku:

I found this issue in Procfile:
web: daphne -b 0.0.0.0 -p 8001 config.asgi:application

which has to be changed to this:

web: daphne config.asgi:application --port $PORT --bind 0.0.0.0 -v2

I will try to commit soon these changes as I finally could deploy with success using Daphne server using ASGI protocol.

And it is not supposed to use the .env file in Heroku like I saw in some issues. This file is not supposed to be used in production but only in dev. So if you want to use in Heroku the variables defined by OS, you should uncomment this in Config>Settings>base.py:

READ_DOT_ENV_FILE = env.bool('DJANGO_READ_DOT_ENV_FILE', default=False) if READ_DOT_ENV_FILE: # OS environment variables take precedence over variables from .env env.read_env(str(ROOT_DIR.path('.env')))

Initially this was a question but since I could solve here's some help.

@gusbakker gusbakker changed the title Deploy to production using Heroku error Problems when deploying to production using Heroku Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants