Benjamin

静以修身,俭以养德,非澹薄无以明志,非宁静无以致远。
随笔 - 397, 文章 - 0, 评论 - 196, 引用 - 0
数据加载中……

kbengine GUIConsole 可视化控制台WebConsole工具django升级到3.1.1的错误解决方法

一、File "D:\kbengine-2.5.8\kbe\tools\server\webconsole\WebConsole\urls.py", line 16, in <module>
    from . import views, auth, views_console, views_profile, views_log, views_watcher, views_status, views_spaceviewer
  File "D:\kbengine-2.5.8\kbe\tools\server\webconsole\WebConsole\views_console.py", line 66, in <module>
    @accept_websocket
  File "D:\kbengine-2.5.8\kbe\tools\server\webconsole\dwebsocket\decorators.py", line 31, in accept_websocket
    func = _setup_websocket(func)
  File "D:\kbengine-2.5.8\kbe\tools\server\webconsole\dwebsocket\decorators.py", line 24, in _setup_websocket
    new_func = decorator(new_func)
  File "C:\Python\lib\site-packages\django\utils\decorators.py", line 117, in _decorator
    middleware = middleware_class(view_func, *m_args, **m_kwargs)
TypeError: object() takes no parameters
decorator_from_middleware方法是无参调用,
def decorator_from_middleware(middleware_class):
    """
    Given a middleware class (not an instance), return a view decorator. This
    lets you use middleware functionality on a per-view basis. The middleware
    is created with no params passed.
    """
    return make_middleware_decorator(middleware_class)()
修改:将dwebsocket\decorators.py中的decorator_from_middleware改为decorator_from_middleware_with_args
from django.utils.decorators import decorator_from_middleware_with_args
decorator = decorator_from_middleware_with_args(WebSocketMiddleware)
二、ERRORS:
?: (admin.E408) 'django.contrib.auth.middleware.AuthenticationMiddleware' must be in MIDDLEWARE in order to use the admin application.
?: (admin.E409) 'django.contrib.messages.middleware.MessageMiddleware' must be in MIDDLEWARE in order to use the admin application.
?: (admin.E410) 'django.contrib.sessions.middleware.SessionMiddleware' must be in MIDDLEWARE in order to use the admin application.
1.将 MIDDLEWARE_CLASSES 改为 MIDDLEWARE  
2.将  'django,contrib.auth.middleware.SessionAuthenticationMiddleware',  删除
三、is not a registered tag library. Must be one of
admin_list
admin_modify
admin_static
admin_urls
cache
i18n
l10n
log
static
staticfiles
tz
修正
{% load staticfiles %}
改成
{% load static %}

posted on 2020-09-19 15:53 Benjamin 阅读(573) 评论(0)  编辑 收藏 引用 所属分类: 杂谈


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理