不正确的配置:中间件模块“django.middleware”没有定义“doc”类

时间:2014-03-09 10:59:34

标签: python django

发生服务器错误。请联系管理员。

  

[10 / Mar / 2014 02:38:15]“GET / HTTP / 1.1”500 59      回溯(最近一次调用最后一次):

  File "C:\Python27\lib\wsgiref\handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "C:\Python27\lib\site-packages\django\contrib\staticfiles\handlers.py", line 67, in __call__
    return self.application(environ, start_response)
  File "C:\Python27\lib\site-packages\django\core\handlers\wsgi.py", line 187, in __call__
self.load_middleware()
  File "C:\Python27\lib\site-packages\django\core\handlers\base.py", line 49, in load_middleware
    mw_instance = mw_class()
  File "C:\Python27\lib\site-packages\django\middleware\locale.py", line 24, in __init__
for url_pattern in get_resolver(None).url_patterns:
  File "C:\Python27\lib\site-packages\django\core\urlresolvers.py", line 346, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "C:\Python27\lib\site-packages\django\core\urlresolvers.py", line 341, in urlconf_module
self._urlconf_module = import_module(self.urlconf_name)
  File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 40, in import_module
__import__(name)
  File "C:\Users\Dmitry\PycharmProjects\Asertova\Asertova\urls.py", line 6, in <module>
admin.autodiscover()
  File "C:\Python27\lib\site-packages\django\contrib\admin\__init__.py", line 29, in autodiscover
import_module('%s.admin' % app)
  File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 40, in import_module
__import__(name)
  File "C:\Python27\lib\site-packages\cms\admin\__init__.py", line 2, in <module>
import pageadmin
  File "C:\Python27\lib\site-packages\cms\admin\pageadmin.py", line 30, in <module>
from cms.admin.change_list import CMSChangeList
  File "C:\Python27\lib\site-packages\cms\admin\change_list.py", line 7, in <module>
from cms.utils.permissions import get_user_sites_queryset
  File "C:\Python27\lib\site-packages\cms\utils\permissions.py", line 4, in <module>
from cms.plugin_pool import plugin_pool
  File "C:\Python27\lib\site-packages\cms\plugin_pool.py", line 3, in <module>
from cms.plugin_base import CMSPluginBase
  File "C:\Python27\lib\site-packages\cms\plugin_base.py", line 85, in <module>
class CMSPluginBase(admin.ModelAdmin):
  File "C:\Python27\lib\site-packages\cms\plugin_base.py", line 30, in __new__
return super_new(cls, name, bases, attrs)
  File "C:\Python27\lib\site-packages\django\forms\widgets.py", line 137, in __new__
attrs)
TypeError: Error when calling the metaclass bases
metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

我不代表如何解决CMS手册上出现的这么多问题......

1 个答案:

答案 0 :(得分:0)

django.middleware.doc中有MIDDLEWARE_CLASSES,但您的系统上不存在settings.py

<小时/> 的编辑:

django.middleware.doc中有拼写错误。

  1. 将{{1}}替换为django.middleware.doc.XViewMiddleware
  2. 将您的IP添加到INTERNAL_IPS
  3. <小时/> django.middleware.doc.XViewMiddleware

    的说明
      

    将自定义X-View HTTP标头发送到来自INTERNAL_IPS设置中定义的IP地址的HEAD请求。这是Django的自动文档系统使用的。取决于AuthenticationMiddleware。