AWS Elastic Beanstalk 需要 SQLite 3.8.3 或更高版本才能用于 Django 应用程序

Posted

技术标签:

【中文标题】AWS Elastic Beanstalk 需要 SQLite 3.8.3 或更高版本才能用于 Django 应用程序【英文标题】:AWS Elastic Beanstalk requires SQLite 3.8.3 or higher for Django Application 【发布时间】:2021-06-26 08:58:29 【问题描述】:

我正在尝试在 AWS Elastic Beanstalk 上上传 Django 应用程序。 我使用了以下教程:

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html

但我在 /admin 上尝试登录后收到以下错误消息

NotSupportedError at /admin/login/
deterministic=True requires SQLite 3.8.3 or higher
Request Method: POST
Request URL:    http://django-env50.eba-3ipauf3e.us-west-2.elasticbeanstalk.com/admin/login/?next=/admin/
Django Version: 3.1.7
Exception Type: NotSupportedError
Exception Value:    
deterministic=True requires SQLite 3.8.3 or higher
Exception Location: /var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/django/db/backends/sqlite3/base.py, line 215, in get_new_connection
Python Executable:  /var/app/venv/staging-LQM1lest/bin/python
Python Version: 3.8.5
Python Path:    
['/var/app/current',
 '/var/app/venv/staging-LQM1lest/bin',
 '/var/app/venv/staging-LQM1lest/bin',
 '/usr/lib64/python38.zip',
 '/usr/lib64/python3.8',
 '/usr/lib64/python3.8/lib-dynload',
 '/var/app/venv/staging-LQM1lest/lib64/python3.8/site-packages',
 '/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages']
Server time:    Mon, 29 Mar 2021 16:23:05 +0000

这是 Pipfile:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
asgiref = "==3.3.1"
pytz = "==2021.1"
sqlparse = "==0.4.1"
Django = "==3.1.7"

[dev-packages]

[requires]
python_version = "3.8"

感谢您的帮助。

【问题讨论】:

遇到同样的问题,请问您是怎么​​解决的? 抱歉回复晚了。解决方案发布在下面。希望对你有帮助。 【参考方案1】:

切换到 Python 3.7 似乎可以解决问题。

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
asgiref = "==3.3.1"
pytz = "==2021.1"
sqlparse = "==0.4.1"
Django = "==3.1.7"

[dev-packages]

[requires]
python_version = "3.7"

【讨论】:

以上是关于AWS Elastic Beanstalk 需要 SQLite 3.8.3 或更高版本才能用于 Django 应用程序的主要内容,如果未能解决你的问题,请参考以下文章

AWS Elastic Beanstalk 中的 mysqlclient 安装错误

在 AWS Elastic Beanstalk 上运行临时脚本

如何在 aws elastic beanstalk 环境实例启动上运行 shell 脚本

Elastic Beanstalk git aws.push 问题

共享 AWS Elastic Beanstalk 配置以将 git 部署到 AWS

Node JS - Elastic Beanstalk AWS - 允许写访问