使用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