我在使用^{
我遵循以下步骤:https://django-constance.readthedocs.io/en/latest/index.html:
pip install "django-constance[database]"
'constance'
和{INSTALLED_APPS
将以下内容放在设置文件的底部(它不是被调用的setings.py
而是common.py
):
CONSTANCE_BACKEND = 'constance.backends.database.DatabaseBackend'
CONSTANCE_DATABASE_PREFIX = 'constance:my_app_name:'
CONSTANCE_CONFIG = {
'THE_ANSWER': (42,
'Answer to the Ultimate Question of Life, The Universe, and Everything'),
}
然后运行python manage.py migrate database
但是没有创建动态设置表。当我试图列出constance
设置时,会发生这种情况:
我运行的是python3.5.2、Django 1.11.3和Django constance 2.0.0。在
有什么线索吗?在
我不太清楚原因,但以下是有效的方法:
存在
database
初始迁移但桌子本身不是
所以我删除了
django_migrations
的迁移重新运行迁移
就这样。
constance list
行为:如果要使用数据库后端更改,请检查项目设置文件上的
INSTALLED_APPS
,请类似于以下内容:Read more
相关问题 更多 >
编程相关推荐