【问题标题】:django-fluent-contents not installing correctly in django.settings.installedAppsdjango-fluent-contents 没有在 django.settings.installedApps 中正确安装
【发布时间】:2019-04-07 05:21:55
【问题描述】:

各位程序员你好,我正在按照步骤安装 django-fluent-contents 来自链接

https://django-fluent-contents.readthedocs.io/en/latest/quickstart.html

1- pip install django-fluent-contents

2- 基本设置 接下来,创建一个使用该模块的项目。可以安装基本模块,也可以添加可选插件:

INSTALLED_APPS += (
'fluent_contents',
'django_wysiwyg',

# And optionally add the desired plugins:
'fluent_contents.plugins.text',                # requires django-wysiwyg
'fluent_contents.plugins.code',                # requires pygments
'fluent_contents.plugins.gist',
'fluent_contents.plugins.googledocsviewer',
'fluent_contents.plugins.iframe',
'fluent_contents.plugins.markup',
'fluent_contents.plugins.rawhtml',

)

3- pip install django-fluent-contents[text,code]

4- 然后运行 ​​python manage.py migrate

然后,错误信息:

D:\projetos\fluent\fluentdemo>python manage.py makemigrations
Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\management\__init__.py", line 381, in     RuntimeError: Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

我试过激活和不激活虚拟环境,同样的错误信息!!

.......然后我听从@solarissmoke 的建议,将 django.contrib.site 添加到 INSTALLED_APPS .... 但现在错误消息是这样的:

    "D:\projetos\fluent\fluentdemo\fluentdemo\veenv\lib\site-packages\fluent_contents\plugins\markup\models.py", line 10, in <module>
    from fluent_contents.plugins.markup import appsettings, backend
  File "D:\projetos\fluent\fluentdemo\fluentdemo\veenv\lib\site-packages\fluent_contents\plugins\markup\appsettings.py", line 34, in <module>
    raise ImproperlyConfigured("The '{0}' package is required to use the '{1}' language for the '{2}' plugin.".format(backendapp, language, 'markup'))
django.core.exceptions.ImproperlyConfigured: The 'docutils' package is required to use the 'restructuredtext' language for the 'markup' plugin.

【问题讨论】:

    标签: django content-management-system django-fluent


    【解决方案1】:

    文档中似乎没有提到它,但是这个应用程序需要安装django.contrib.sites,你会收到一个错误,因为它不是。

    尝试将django.contrib.sites 添加到您的INSTALLED_APPS。

    【讨论】:

    • 是的,我将 django.contrib.sites 添加到 INSTALLED_APPS,现在错误消息不同 -> 文件 "D:\projetos\fluent\fluentdemo\fluentdemo\veenv\lib\site-packages\ fluent_contents\plugins\markup\appsettings.py",第 34 行,在 中 raise ImproperlyConfigured("'{0}' 包需要使用 '{1}' 语言用于 '{2}' 插件。" .format(backendapp, language, 'markup')) django.core.exceptions.ImproperlyConfigured: 'docutils' 包需要使用'restructuredtext' 语言的'markup' 插件。
    • 您缺少更多依赖项。 pip install docutils。记录在案:django-fluent-contents.readthedocs.io/en/latest/plugins/…
    猜你喜欢
    • 2014-01-03
    • 2017-03-21
    • 2017-04-26
    • 2019-01-07
    • 2019-01-27
    • 1970-01-01
    • 1970-01-01
    • 2017-07-23
    • 2012-09-04
    相关资源
    最近更新 更多