我第一次使用 Procfileweb: python manage.py runserver '0.0.0.0:$PORT'
成功启动,但在第一次git push
它崩溃了这个错误:
OperationalError at /
could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
重新启动 webrunner 没有帮助。有什么诀窍?heroku 日志输出:
2013-11-25T23:39:56.725138+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/psycopg2/__init__.py", line 164, in connect
2013-11-25T23:39:56.725138+00:00 app[web.1]: conn = _connect(dsn, connection_factory=connection_factory, async=async)
2013-11-25T23:39:56.725138+00:00 app[web.1]: OperationalError: could not connect to server: Connection refused
2013-11-25T23:39:56.725138+00:00 app[web.1]: Is the server running on host "127.0.0.1" and accepting
2013-11-25T23:39:56.725138+00:00 app[web.1]: TCP/IP connections on port 5432?
2013-11-25T23:39:56.725138+00:00 app[web.1]: return Database.connect(**conn_params)
2013-11-25T23:39:56.725138+00:00 app[web.1]:
2013-11-25T23:39:56.872620+00:00 app[web.1]: [26/Nov/2013 00:39:56] "GET / HTTP/1.1" 500 118846
使用 gunicorn 它说找不到 gunicorn 应用程序和app[web.1]: bash: gunicorn: command not found and heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=shrouded-falls-4631.herokuapp.com fwd="188.163.187.182" dyno= connect= service= status=503 bytes=
从 heroku 日志和heroku ps
显示崩溃的应用程序 [web]。至少在第一次开始使用 djangos 的 runserver。但后来也摔倒了。