Jac*_*022 1 python django heroku django-channels
我正在尝试将 Django 应用程序部署到 Heroku,但我不断收到以下错误:
2020-04-13T08:45:00.134349+00:00 app[web.1]: Traceback (most recent call last):
2020-04-13T08:45:00.134389+00:00 app[web.1]: File "/app/.heroku/python/bin/daphne", line 8, in <module>
2020-04-13T08:45:00.134519+00:00 app[web.1]: sys.exit(CommandLineInterface.entrypoint())
2020-04-13T08:45:00.134524+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/daphne/cli.py", line 191, in entrypoint
2020-04-13T08:45:00.134697+00:00 app[web.1]: cls().run(sys.argv[1:])
2020-04-13T08:45:00.134699+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/daphne/cli.py", line 252, in run
2020-04-13T08:45:00.134891+00:00 app[web.1]: application = import_by_path(args.application)
2020-04-13T08:45:00.134913+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/daphne/utils.py", line 14, in import_by_path
2020-04-13T08:45:00.135028+00:00 app[web.1]: target = getattr(target, bit)
2020-04-13T08:45:00.135056+00:00 app[web.1]: AttributeError: module 'mysite.asgi' has no attribute 'channel_layer
Run Code Online (Sandbox Code Playgroud)
这是我的 Procfile:
web: daphne WR.asgi:channel_layer --port $PORT --bind 0.0.0.0 -v2
Run Code Online (Sandbox Code Playgroud)
这是我在settings.py上定义 Redis 的方式:
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {
"hosts": [('https://mytestapp1.herokuapp.com/', 6379)],
'capacity': 1500,
'expiry': 2,
},
},
}
Run Code Online (Sandbox Code Playgroud)
谁能帮我找出我做错了什么?难道我必须将 Redis heroku 插件添加到我的应用程序中吗?
| 归档时间: |
|
| 查看次数: |
1218 次 |
| 最近记录: |