zoukankan      html  css  js  c++  java
  • django.contrib.auth.middleware.AuthenticationMiddleware' must be in MIDDLEWARE in order to use the admin application.

    错误日志

    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.

    解决办法

    # django 1.11
    # MIDDLEWARE_CLASSES = (
    #     'django.contrib.sessions.middleware.SessionMiddleware',
    #     'django.middleware.common.CommonMiddleware',
    #     'django.middleware.csrf.CsrfViewMiddleware',
    #     'django.contrib.auth.middleware.AuthenticationMiddleware',
    #     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    #     'django.contrib.messages.middleware.MessageMiddleware',
    #     'django.middleware.clickjacking.XFrameOptionsMiddleware',
    #     'django.middleware.security.SecurityMiddleware',
    # )
    
    # django 2
    MIDDLEWARE = [
        'django.middleware.security.SecurityMiddleware',
        'django.contrib.sessions.middleware.SessionMiddleware',
        'django.middleware.common.CommonMiddleware',
        'django.middleware.csrf.CsrfViewMiddleware',
        'django.contrib.auth.middleware.AuthenticationMiddleware',
        'django.contrib.messages.middleware.MessageMiddleware',
        'django.middleware.clickjacking.XFrameOptionsMiddleware',
    ]
  • 相关阅读:
    该扩展程序未列在 Chrome 网上应用店中,并可能是在您不知情的情况下添加的
    dependency
    libiconv库链接问题一则
    dll = MinGW gcc 生成动态链接库 dll 的一些问题汇总
    益智
    智游推送CTO浅谈推送服务
    如何实现高效处理百万级句柄
    推送的心跳机制
    市面上Android推送方案存在的问题
    推送方案的比较
  • 原文地址:https://www.cnblogs.com/qianzf/p/14119482.html
Copyright © 2011-2022 走看看