Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/361.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Heroku上的Python应用程序部署导致应用程序错误H10_Python_Django_Git_Heroku_Web Deployment - Fatal编程技术网

Heroku上的Python应用程序部署导致应用程序错误H10

Heroku上的Python应用程序部署导致应用程序错误H10,python,django,git,heroku,web-deployment,Python,Django,Git,Heroku,Web Deployment,我试图将我的Python项目部署到Heroku,我遵循了Heroku的教程,但仍然得到一个应用程序错误 (ISproject) Hessas-MBP-2:ISproject hessaaljeri$ git push heroku master Counting objects: 9, done. Delta compression using up to 4 threads. Compressing objects: 100% (9/9), done. Writing objects: 1

我试图将我的Python项目部署到Heroku,我遵循了Heroku的教程,但仍然得到一个应用程序错误

  (ISproject) Hessas-MBP-2:ISproject hessaaljeri$ git push heroku master
Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 985 bytes | 0 bytes/s, done.
Total 9 (delta 7), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote:       /app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/b in/steps/python: line 7: [: too many arguments
 remote: -----> Installing requirements with pip
 remote: 
 remote: -----> $ python manage.py collectstatic --noinput
 remote:        180 static files copied to    '/tmp/build_eb1f0e2e350e841c604cef9887a7c8c2/static'.
 remote: 
 remote: -----> Discovering process types
 remote:        Procfile declares types -> web
 remote: 
 remote: -----> Compressing...
 remote:        Done: 74.8M
 remote: -----> Launching...
 remote:        Released v6
 remote:        https://charitycba.herokuapp.com/ deployed to Heroku
 remote: 
 remote: Verifying deploy.... done.
 To https://git.heroku.com/charitycba.git
 2890bc6..116d04a  master -> master
 (ISproject) Hessas-MBP-2:ISproject hessaaljeri$ heroku run ./manage.py   migrate
 Running ./manage.py migrate on ⬢ charitycba... up, run.7297 (Free)
 Operations to perform:
 Synchronize unmigrated apps: crispy_forms, messages, datetimewidget,  staticfiles, geoposition
 Apply all migrations: auth, sessions, admin, registration, contenttypes, app, sites
 Synchronizing apps without migrations:
 Creating tables...
 Running deferred SQL...
 Installing custom SQL...
 Running migrations:
 No migrations to apply.
之后,当我打开它时,我会看到:

Heroku日志文件:

 2017-06-02T21:43:25.157364+00:00 heroku[run.5045]: Starting process  with command `./manage.py migrate`
 2017-06-02T21:43:25.231039+00:00 heroku[run.5045]: State changed from  starting to up
2017-06-02T21:43:33.626152+00:00 heroku[run.5045]: State changed from up to complete
 2017-06-02T21:43:33.611887+00:00 heroku[run.5045]: Process exited with status 0
 2017-06-02T21:43:46.905298+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=charitycba.herokuapp.com  request_id=112cc8a0-cb4a-4039-bc79-e76980a4a287 fwd="31.203.118.236" dyno= connect= service= status=503 bytes= protocol=https
 2017-06-02T21:44:24.998284+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=charitycba.herokuapp.com request_id=fe3bb21b-b3ea-4ea3-bc45-b0084aad829e fwd="31.203.118.236" dyno= connect= service= status=503 bytes= protocol=https
 2017-06-02T21:45:22.765792+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=charitycba.herokuapp.com request_id=f54d4bac-d8b6-422d-b24a-1f655c6ea2c5 fwd="31.203.118.236" dyno= connect= service= status=503 bytes= protocol=https
我遗漏了什么?

我是如何修复的:

在my settings.py中:

STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
STATIC_URL = '/static/'

STATICFILES_DIRS = (
   os.path.join(PROJECT_ROOT, '../app/static'),
)
“../app/static”我告诉它进入一个目录,进入我的应用程序,其中包含我的静态文件夹

在我的档案里

web: gunicorn project.wsgi --log-file -
我用project.wsgi替换了gettingstarted.wsgi
因为wsgi.py在我的项目文件夹中。

检查日志以了解详细信息,并将其发布在此处。我猜这是一个500错误。我不使用heroku,但您发布的内容看起来像部署日志,而不是应用程序日志。您的Procfile是什么样子的?@BojanKogoj web:gunicorn gettingstarted.wsgi--log file--您能否尝试删除
--log file-
,这可能会阻止日志消息出现在heroku上,但我不确定。