【问题标题】:Run flask app on gunicorn,but app can't insert into the db在 gunicorn 上运行烧瓶应用程序,但应用程序无法插入数据库
【发布时间】:2015-10-20 17:27:04
【问题描述】:

我正在通过 Miguel Grinberg 的“Flask Web 开发: 使用 Python 开发 Web 应用程序。”而在第 8 章:用户认证中,它讨论了添加用户注册表以注册新用户。

当我使用 Flask 的网络服务器运行应用程序时:

python manage.py runserver -d -h 0.0.0.0   

我可以注册一个新的帐户 ID 并使用它来登录。

但是当我使用 gunicorn 网络服务器运行应用程序时:

gunicorn manage:app

当我注册一个新的账号id,提交后没有任何提示,使用新的账号id登录,账号id不存在。

【问题讨论】:

    标签: database flask gunicorn


    【解决方案1】:

    我找到了原因:使用 Postgresql 而不是 SQLite

    【讨论】:

      猜你喜欢
      • 2020-04-16
      • 2021-12-23
      • 2012-11-19
      • 1970-01-01
      • 1970-01-01
      • 2020-05-23
      • 1970-01-01
      • 2021-01-05
      • 1970-01-01
      相关资源
      最近更新 更多