【发布时间】:2017-10-20 18:22:50
【问题描述】:
我正在尝试使用 ElasticBeanstalk 安装 Django 应用程序。除了settings.DATABASES is improperly configured. Please supply the ENGINE value
完全错误:
Command failed on instance. Return code: 1 Output: (TRUNCATED)... in
complain raise ImproperlyConfigured("settings.DATABASES is improperly
configured. " django.core.exceptions.ImproperlyConfigured:
settings.DATABASES is improperly configured. Please supply the ENGINE value.
Check settings documentation for more details.
container_command 01_migrate in .ebextensions/15_my.config failed. For more
detail, check /var/log/eb-activity.log using console or EB CLI.`
我在执行我的一个命令时收到此错误:
01_migrate:
command: "source /opt/python/run/venv/bin/activate && python manage.py migrate --noinput"
leader_only: True
这是我的 config/settings/production.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'ebdb',
'USER': 'djangousername',
'PASSWORD': 'djangopassword',
'HOST': env('RDS_HOSTNAME'),
'PORT': '5432'
}
}
我有点确定 EB 仅从该文件中选择配置,而不是从任何其他文件中选择配置,因为如果我更改此文件中的某些内容,它会在 ElasticBeanstalk 环境创建时反映出来。我还在整个应用程序中搜索了 DATABASES 仅在此文件中提及,即 <app-rot>/config/settings/production.py 或 <app-root>/config/settings/local.py。在这两个地方,我都提供了上面的ENGINE 值。
如果我需要添加任何其他相关信息,请告诉我
【问题讨论】:
-
但是你如何告诉 Django 查看设置/生产?
标签: python django postgresql amazon-elastic-beanstalk