如何将Django asgi项目部署到Heroku?

时间:2019-06-19 16:45:02

标签: python django heroku channels daphne

当我尝试部署到Heroku时,构建成功,但无法正常工作。

在Heroku日志--tail中,我得到:     进程退出,状态为127     bash:daphne:找不到命令

我尝试找到Daphne安装目录,但找不到。

我的Procfile包含:

web: daphne chatapp.asgi:channel_layer --port $PORT --bind 0.0.0.0 -v2
chatworker: python manage.py runworker -v2


In my settings.py for the CHANNEL_LAYERS I have:
    CHANNEL_LAYERS = {
        "default": {
        "BACKEND": "channels_redis.core.RedisChannelLayer",
        "CONFIG": {
            "hosts": [os.environ.get('REDIS_URL', 6379)],
        },
    },
}

在我的asgi.py文件中,我有:

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "chatapp.settings")
django.setup()
application = get_default_application()
channel_layer = get_channel_layer()

0 个答案:

没有答案
相关问题