django错误笔记(xadmin)——AttributeError: 'Settings' object has no attribute 'TEMPLATE_CONTEXT_PROCESSORS'

使用Xadmin,执行makemigrations和migrate时运行报错提示:

AttributeError: ‘Settings‘ object has no attribute ‘TEMPLATE_CONTEXT_PROCESSORS‘

方法一:

setting.py文件添加以下信息:

TEMPLATE_CONTEXT_PROCESSORS = (
 ‘django.contrib.auth.context_processors.auth‘,
 ‘django.core.context_processors.auth‘
 ‘django.core.context_processors.debug‘,
 ‘django.core.context_processors.media‘,
 ‘django.core.context_processors.static‘,
 ‘django.core.context_processors.tz‘,
 ‘django.contrib.messages.context_processors.messages‘,
 ‘learn_models.context_processors.test‘,
)

方法二:

https://github.com/sshwsfc/xadmin下载源码,因为github该Bug被修复了,而pypi没有更新导致的。

django错误笔记(xadmin)——AttributeError: 'Settings' object has no attribute 'TEMPLATE_CONTEXT_PROCESSORS'

原文地址:https://www.cnblogs.com/youleng/p/9047550.html

时间: 2024-10-12 18:27:40

django错误笔记(xadmin)——AttributeError: 'Settings' object has no attribute 'TEMPLATE_CONTEXT_PROCESSORS'的相关文章

Python python __def__ Exception AttributeError: "'NoneType' object has no attribute

class Person: '''Represents a person.''' population = 0 def __init__(self,name): '''Initializes the person's data.''' self.name = name print '(Initializing %s)' % self.name Person.population +=1 def __del__(self): '''I am dying.''' print '%s says bye

启动celery的时候提示:AttributeError: 'module' object has no attribute 'commit_manually'错误

1. 首先进入虚拟环境: ***:~/piaoshifu_object/epiao.piaoshifu.cn$ source /home/wyl/piaoshifu_virtualenv/epiaoenv/bin/activate (epiaoenv) ***:~/piaoshifu_object/epiao.piaoshifu.cn$ 2. 启动celery: ***:~/piaoshifu_object/epiao.piaoshifu.cn$ python manage.py celery

Django admin 中抛出 'WSGIRequest' object has no attribute 'user'的错误

这是Django版本的问题,1.9之前,中间件的key为MIDDLEWARE_CLASSES, 1.9之后,为MIDDLEWARE.所以在开发环境和其他环境的版本不一致时,要特别小心,会有坑. 将settings里的MIDDLEWARE_CLASSES默认配置顺序改成如下 MIDDLEWARE_CLASSES = [ 'django.middleware.security.SecurityMiddleware', 'django.middleware.common.CommonMiddlewar

Django项目与mysql交互进行数据迁移时报错:AttributeError: 'str' object has no attribute 'decode'

问题描述 Django项目启动,当我们执行命令 python manage.py makemigrations 出现如下错误: File "/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/operations.py", line 147, in last_executed_query query = query.decode(errors='replace') AttributeError: 'str' o

Django 1.8 admin 产生'WSGIRequest' object has no attribute 'user'的错误

配置admin时,产生'WSGIRequest' object has no attribute 'user'的错误 google了下,说是MIDDLEWARE配置的有问题,顺序应该保持参见(http://stackoverflow.com/questions/26576192/wsgirequest-object-has-no-attribute-user): 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.

flask_route错误:AttributeError: 'function' object has no attribute 'route'

问题: 路由完全正确,当只有一个名为home的函数处理这个路由时候,下一个路由处理函数,总是提示没有这个rotue属性 Traceback (most recent call last): File "E:/workspace/wei-move/manage.py", line 3, in <module> from app import app File "E:\workspace\wei-move\app\__init__.py", line 10,

python 错误AttributeError: &#39;module&#39; object has no attribute &#39;AF_INET&#39;

写了一个简单的python socket的程序.运行时,报错如下 原因:文件的命名与Python的function的命名冲突 修改名称后,发现还是无法运行,检查目录下面是否有 这样子的一个文件,删除即可. 据我的理解,应该是我们自己命名重写了Python的socket函数. 附上我的小代码 import socket mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) mysock.connect(('data.pr4e.org'

Python错误:AttributeError: &#39;generator&#39; object has no attribute &#39;next&#39;解决办法

今天在学习生成器对象(generation object)运行以下代码时,遇到了一个错误: #定义生成器函数def liebiao(): for x in range(10): yield x#函数调用g = liebiao() #打印元素print(g.next())D:\>python test.pyTraceback (most recent call last): File "test.py", line 10, in <module> print(g.nex

AttributeError: &#39;Table&#39; object has no attribute &#39;plot&#39;错误

今天在用到camelot爬取pdf的表格时,想选取部分区域进行爬取,就想用plot把pdf画一下,选个坐标. 看了网上的示例,在使用camelot.read_pdf获取当前页面以后调用tables[0].plot('text'),提示AttributeError: 'Table' object has no attribute 'plot' 翻了半天各种博客都是转来转去一样的示例,直到看见 https://www.jianshu.com/p/dbce34122c2b 里写了,是用 plt = c