django导入'django.template.context_processors.media'后报错如下:

ERRORS:
?: (admin.E402) 'django.contrib.auth.context_processors.auth' must be enabled in DjangoTemplates (TEMPLATES) if using the default auth backend in order to use the admin application.
问题代码:

TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates','DIRS': [os.path.join(BASE_DIR,'templates')],'APP_DIRS': True,'OPTIONS': {'context_processors': ['django.template.context_processors.debug','django.template.context_processors.request','django.template.context_processors.media''django.contrib.auth.context_processors.auth','django.contrib.messages.context_processors.messages',],},},
]

将'django.template.context_processors.media'调整至最后即可解决

TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates','DIRS': [os.path.join(BASE_DIR,'templates')],'APP_DIRS': True,'OPTIONS': {'context_processors': ['django.template.context_processors.debug','django.template.context_processors.request','django.contrib.auth.context_processors.auth','django.contrib.messages.context_processors.messages','django.template.context_processors.media'],},},
]

django报错ERRORS:?: (admin.E402) ‘django.contrib.auth.context_processors.auth‘相关推荐

  1. ERRORS: ?: (admin.E408) 'django.contrib.auth.middleware.AuthenticationMiddleware' must be in MIDDLEW

    完整报错如下: Traceback (most recent call last):   File "/usr/lib/python3.7/threading.py", line ...

  2. django报错: Specifying a namespace in include() without providing an app_name

    django报错: 'Specifying a namespace in include() without providing an app_name ' django.core.exception ...

  3. Django报错:“Key ‘id‘ not found in ‘xxx‘

    Django报错:"Key 'id' not found in 'xxx' 在写django的时候发现了这个错误,id一开始一脸懵逼,id字段不可能不存在啊... 查了一下发现问题在admi ...

  4. Django报错 ValueError: The view didn‘t return an HttpResponse object. It returned None instead.

    Django报错 ValueError: The view *** didn't return an HttpResponse object. It returned None instead. __ ...

  5. django报错TypeError: __init__() missing 1 required positional argument: 'on_delete'

    个人博客页面链接:http://www.shihao.online (django搭建的个人博客,还在完善中) django报错 TypeError: __init__() missing 1 req ...

  6. 运行bert模型报错No module named ‘tensorflow.contrib‘

    命令行报错如下: import tensorflow.contrib.slim as slim ModuleNotFoundError: No module named 'tensorflow.con ...

  7. 【错误记录】PyCharm 运行 Python 程序报错 ( PEP 8: E402 module level import not at top of file )

    文章目录 一.报错信息 二.解决方案 一.报错信息 PyCharm 运行 Python 程序报错 : PEP 8: E402 module level import not at top of fil ...

  8. Django报错SocialApp matching query does not exist以及Django的SITE_ID = 1的含义

    搞第三方授权登录的时候 完整报错如下: DoesNotExist at /accounts/github/login/ SocialApp matching query does not exist. ...

  9. 启动django报错:TypeError: __init__() got an unexpected keyword argument ‘providing_args‘

    问题一:django跨域 现象: has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present ...

最新文章

  1. og-bin=mysql-bin_init_connect + binlog 记录 mysql 操作日志
  2. 什么时候使用Shell
  3. 微博预计要火一阵的SleepSort之Shell及C实现
  4. 线性求所有逆元的方法
  5. oracle注入过滤了单引号,sql绕过单引号限制继续注入的解决方法
  6. 计算机专业最低院校门槛,2021年全国各省高考高校录取最低位次排名查询系统...
  7. 【Oracle】跟踪文件目录(User_Dump_Dest)生成脚本(11g/9i).txt
  8. Python程序-输出1000以内素数
  9. mysql创建工作经历表_国内首款 Serverless MySQL 数据库重磅发布!
  10. 亚马逊数据线办理CE认证检测项目有哪些?如何办理?
  11. Python基础:dict字典表
  12. 带你初步了解生物网络分析
  13. 系统集成项目管理工程师13《项目配置管理》
  14. android高效ORM数据库框架greenDao使用
  15. c语言提取质心坐标,求图像质心的C语言实现
  16. Promise中then的返回值
  17. V4L2视频驱动程序开发之驱动方法poll 和 应用程序select
  18. 仿QQ音乐css布局
  19. 删除服务 MySQL mysql删除服务 无法删除服务
  20. springboot+人事信息管理系统 毕业设计-附源码221507

热门文章

  1. Linux GCC简明教程(使用GCC编译C语言程序)
  2. 关于福昕阅读器启动速度慢的问题
  3. 原谅我一直对B站有误解!
  4. Office课程习题
  5. C#超市进销存系统管理源码(CS架构)
  6. 浙大版《C语言程序设计》第四版(何钦铭颜晖) 第11章 指针进阶 课后习题答案
  7. 南瓜节(PumpkinFestival)| 终极南瓜系列挑战
  8. nn.Parameter
  9. ip地址大全_2020全球公共 DNS 服务器 IP 地址大全
  10. oracle中treat函数,PL/SQL Challenge 每日一题:2016-3-24 面向对象编程:向下转型TREAT...