【问题标题】:ElasticBeanstalk - SQLite version is wrong, how do I fix this for my django project?ElasticBeanstalk - SQLite 版本错误,如何为我的 django 项目解决此问题?
【发布时间】:2021-05-17 20:21:59
【问题描述】:

我正在 Amazon Elastic Beanstalk 上运行一个 Django 项目。我遇到了 500 错误。我已经追踪到我的错误与 SQLite 相关

[Sun Feb 14 20:02:02.485066 2021] [:error] [pid 419]     check_sqlite_version()
[Sun Feb 14 20:02:02.485072 2021] [:error] [pid 419]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/backends/
sqlite3/base.py", line 67, in check_sqlite_version
[Sun Feb 14 20:02:02.485075 2021] [:error] [pid 419]     raise ImproperlyConfigured('SQLite 3.8.3 or later is required (found %s).' % D
atabase.sqlite_version)
[Sun Feb 14 20:02:02.485096 2021] [:error] [pid 419] django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (fo
und 3.7.17).

我似乎没有任何能力在 EB 上升级 SQLLite。我的 SSH 访问是只读的。我应该如何让 Django 在这种环境中工作?

Requirements.txt:

asgiref==3.3.1
Django==3.1.6
Pillow==8.1.0
pytz==2021.1
sqlparse==0.4.1

【问题讨论】:

标签: python django amazon-web-services amazon-elastic-beanstalk


【解决方案1】:

我花了很长时间才弄明白,所以无论谁掉进这个兔子洞,答案都是:

以下是我的 requirements.txt 最终结果(除了需求库。

asgiref==3.3.4
certifi==2021.5.30
chardet==4.0.0
Django==2.1.15
idna==2.10
pytz==2021.1
requests==2.25.1
sqlparse==0.4.1
typing-extensions==3.10.0.0
urllib3==1.26.5

问题来自 django 版本控制,因此您需要 pip install django==2.1.* 然后将 sqlite 版本控制放回需求后才能工作

pip freeze > requirements.txt

【讨论】:

    猜你喜欢
    • 2017-05-09
    • 1970-01-01
    • 1970-01-01
    • 2019-04-29
    • 1970-01-01
    • 2019-10-26
    • 2021-09-23
    • 1970-01-01
    • 2021-12-25
    相关资源
    最近更新 更多