django 2部署到heroku失败-at =错误代码= H10 desc =“应用程序崩溃”

时间:2019-01-23 17:44:39

标签: django heroku deployment

我的构建成功,但是我的heroku网站返回了我错误。 我使用heroku日志--tail来查看错误消息。 它是这样的:

  

2019-01-23T17:33:34.339263 + 00:00 app [web.1]:文件   “ /app/notetaking/prod_settings.py”,第4行   2019-01-23T17:33:34.339264 + 00:00 app [web.1]:SECURE_PROXY_SSL_HEADER =   ('HTTP_X_FORWARDED_PROTO','https')2019-01-23T17:33:34.339266 + 00:00   应用[web.1]:^ 2019-01-23T17:33:34.339267 + 00:00应用[web.1]:   SyntaxError:标识符中的字符无效

     

构建成功   2019-01-23T17:34:37.203663 + 00:00 heroku [router]:at =错误代码= H10 desc =“应用程序崩溃” method = GET path =“ /”

     

host = multilingualnotetaking.herokuapp.com request_id = f964ab62-fac9-40f8-84a5-26bea61f183d fwd =“ 39.10.71.43” dyno = web.1 connect = 5001ms服务=状态= 503字节=协议= https

     

2019-01-23T17:34:38.222491 + 00:00 heroku [router]:at =错误代码= H10 desc =“应用程序崩溃”方法= GET path =“ / favicon.ico” host = multilingualnotetaking.herokuapp。 com request_id = 069cc8d6-41d9-4d13-b8e2-be0a982b1279 fwd =“ 39.10.71.43” dyno = connect = service = status = 503字节= protocol = https

proc_settings.py(我强烈怀疑此文件无效。

import notetaking.settings
import os
STATIC_ROOT='staticfiles'
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO','https')

ALLOWED_HOSTS = ['*']

DEBUG = False
import dj_database_url
DATABASES = {
    'default': dj_database_url.config()
}

Procfile:

web: gunicorn --pythonpath notetaking notetaking.wsgi -b 0.0.0.0:$PORT 
gunicorn project.wsgi:application --preload --workers 1

runtime.txt

python-3.7.1

requirements.txt

dj-database-url==0.5.0
dj-static==0.0.6
Django==2.1.5
djangorestfra

mework==3.9.1
gunicorn==19.9.0
mysqlclient==1.4.1
numpy==1.16.0
pandas==0.23.4
Pillow==5.4.1
psycopg2==2.7.7
python-dateutil==2.7.5
pytz==2018.9
six==1.12.0
static3==0.7.0
xlrd==1.2.0

heroku重新启动对我不起作用。 我使用的字体太棒了,我不知道这在部署时是否会引起问题。

1 个答案:

答案 0 :(得分:0)

更改Procfile对我有用 表格

web: gunicorn django_project.wsgi

web: gunicorn django_project.wsgi:application --log-file - --log-level debug
python manage.py collectstatic --noinput
manage.py migrate