Skip to content

Problems when deploying to production using Heroku #231

@gusbakker

Description

@gusbakker

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions