【问题标题】:when ı connect Heroku Postgres to Heroku ı get an internal server error当我将 Heroku Postgres 连接到 Heroku 时,我得到一个内部服务器错误
【发布时间】:2021-10-02 05:40:04
【问题描述】:

我有一个烧瓶应用程序我想在 Heroku 上部署它在没有 Heroku Postgres 的情况下工作但是当我添加 Heroku Postgres 时我得到以下错误

--- no python application found, check your startup logs for errors ---
2021-07-26T07:55:39.367930+00:00 app[web.1]: {address space usage: 57741312 bytes/55MB} {rss usage: 12115968 bytes/11MB} [pid: 7|app: -1|req: -1/4] 10.32.150.15 () {58 vars in 1134 bytes} [Mon Jul 26 07:55:39 2021] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
2021-07-26T07:55:39.370298+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=flask-first-example.herokuapp.com request_id=c4a978b4-bff6-46cb-bcdf-a626d12ea301 fwd="85.98.12.22" dyno=web.1 connect=3ms service=5ms status=500 bytes=104 protocol=https

虽然我尝试了很多方法,但我无法解决问题

https://github.com/yunusaltuntas/flask-example.git

【问题讨论】:

    标签: python-3.x postgresql flask heroku sqlalchemy


    【解决方案1】:

    目录中有 Procfile 和 requirements.txt 文件吗?如果没有,请创建一个文件名“Procfile”并插入以下web: gunicorn app:app。在我的情况下,我的烧瓶应用程序文件名为 app.py,这不是我使用 app:app 的原因。 requirements.txt 文件应该包含您的应用程序需要的所有模块,您可以使用pip3 freeze > requirements.txt 执行此操作,使用您的应用程序使用的 pip 版本。这可能会有所帮助。

    【讨论】:

      猜你喜欢
      • 2023-04-07
      • 2020-07-30
      • 1970-01-01
      • 2019-06-18
      • 2020-05-17
      • 1970-01-01
      • 2014-07-05
      • 2018-01-11
      • 1970-01-01
      相关资源
      最近更新 更多