我试图部署我的应用程序--我的EB状态--它返回了绿色,所以它正在工作
因此,我将我的应用程序部署在本地的So中--我做了python make migrations python migrate eb deploy和eb status。
helth返回绿色,因此它的工作,但当我进入网站,它返回deterministic=True requires SQLite 3.8.3 or higher
注意:在当地,它运行得很好。
django.config:
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: store.wsgi:application我运行的命令使我的项目:
python manage.py mamemigrations
python manage.py migrate
python manage.py createsuperuser
eb init python-3.8 Naameofmyproject
eb create NameofmyprojectRequirments.txt:
asgiref==3.5.0
autopep8==1.6.0
certifi==2021.10.8
charset-normalizer==2.0.12
dj-database-url==0.5.0
Django==4.0.3
django-anymail==8.5
django-autoslug==1.9.8
django-crispy-forms==1.14.0
django-environ==0.8.1
django-model-utils==4.2.0
idna==3.3
Pillow==9.1.0
psycopg2-binary==2.9.3
pycodestyle==2.8.0
python-dateutil==1.5
requests==2.27.1
six==1.16.0
sqlparse==0.4.2
stripe==2.70.0
toml==0.10.2
tzdata==2022.1
urllib3==1.26.9settings.py:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
STATIC_URL = '/static/'
STATIC_ROOT = BASE_DIR / 'static'
STATICFILES_DIRS = [BASE_DIR / 'templates/static']
MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'media'
CART_SESSION_ID = 'cart'
AUTH_USER_MODEL = 'account.UserBase'
LOGIN_REDIRECT_URL = '/account/dashboard'
LOGIN_URL = '/account/login/'
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'发布于 2022-07-02 20:27:56
第零步:显而易见--确保您的项目正常工作,并且数据库具有更新的迁移。
然后按照以下步骤操作:
您将获得诸如主机、数据库、用户、端口、密码、URI等凭据。

这就是我从Heroku那里得到的。为了安全起见我把证件藏起来了。

我正在从django手册中复制和粘贴一个示例(您可以复制并粘贴到settings.py文件中):
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.oracle',
'NAME': 'xe',
'USER': 'a_user',
'PASSWORD': 'a_password',
'HOST': 'dbprod01ned.mycompany.com',
'PORT': '1540',
}
}将“引擎”字段设置为:
'ENGINE': 'django.db.backends.postgresql',来源:https://docs.djangoproject.com/en/4.0/ref/databases/
使用云上postgres资源提供的正确值填充字段。
。
您需要procfile中的一行文本:
web: gunicorn [PROJECT NAME].wsgi您的项目名称将在wsgi.py中作为项目NAME.settings找到。

重要:在更改settings.py脚本中的数据库后,删除旧迁移(它们属于SQLite)。右键单击迁移文件夹,显示内容,删除除__ init __.py文件之外的所有内容。
然后创建用于postgres数据库的新迁移:
python manage.py makemigrations现在重新部署。
https://stackoverflow.com/questions/71967771
复制相似问题