【问题标题】:I am deploying Django App on heroku, after successful deployment , I am getting operational Error我正在 Heroku 上部署 Django App,成功部署后,出现操作错误
【发布时间】:2017-02-23 17:43:45
【问题描述】:
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']

【问题讨论】:

    标签: python django python-2.7 heroku


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-22
      • 1970-01-01
      • 1970-01-01
      • 2015-03-31
      • 1970-01-01
      • 2021-06-28
      • 2021-10-29
      • 1970-01-01
      相关资源
      最近更新 更多