我在heroku上部署Django App,成功部署后,我正在运行错误

时间:2016-10-14 10:15:27

标签: python django python-2.7 heroku

OperationalError at /admin/login/
could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Request Method: POST
Django Version: 1.10b1
Exception Type: OperationalError
Exception Value:    
could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Exception Location: /app/.heroku/python/lib/python2.7/site-packages/psycopg2/__init__.py in connect, line 164
Python Executable:  /app/.heroku/python/bin/python
Python Version: 2.7.12
Python Path:    
['/app',
 '/app/.heroku/python/bin',
 '/app',
 '/app/.heroku/python/lib/python27.zip',
 '/app/.heroku/python/lib/python2.7',
 '/app/.heroku/python/lib/python2.7/plat-linux2',
 '/app/.heroku/python/lib/python2.7/lib-tk',
 '/app/.heroku/python/lib/python2.7/lib-old',
 '/app/.heroku/python/lib/python2.7/lib-dynload',
 '/app/.heroku/python/lib/python2.7/site-packages',
 '/app/.heroku/python/lib/python2.7/site-packages/setuptools-25.2.0-py2.7.egg',
 '/app/.heroku/python/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg']

1 个答案:

答案 0 :(得分:1)

您的数据库设置存在问题。您必须修改数据库设置才能部署到Heroku。我从未使用它,但此页面解释了如何为Django配置数据库: https://devcenter.heroku.com/articles/django-app-configuration