2017-05-24 136 views
0

我最近更新了Django網站管理已損壞(我必須添加我不知道這是否是問題的根本原因,因爲我沒有使用它一段時間,只是剛剛注意到它。Django網站管理員破壞

我得到以下錯誤:。

Internal Server Error: /admin/ 

TemplateSyntaxError at /admin/ 
'future' is not a registered tag library. Must be one of: 
account 
account_tags 
admin_list 
admin_modify 
admin_static 
admin_urls 
avatar_tags 
cache 
crispy_forms_field 
crispy_forms_filters 
crispy_forms_tags 
crispy_forms_utils 
dwadfilters 
humanize 
i18n 
l10n 
log 
mathfilters 
socialaccount 
socialaccount_tags 
static 
staticfiles 
tinymce_tags 
tz 

我有一個顯得圓潤一些所提出的建議是一個bug有人說,降級到1.8(這是不是一種選擇),我將會把在這封電子郵件底部的回溯。非常感謝您提前幫助。

Traceback: 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner 
    39.    response = get_response(request) 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response 
    249.    response = self._get_response(request) 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response 
    217.     response = self.process_exception_by_middleware(e, request) 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response 
    215.     response = response.render() 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/template/response.py" in render 
    109.    self.content = self.rendered_content 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/template/response.py" in rendered_content 
    86.   content = template.render(context, self._request) 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/template/backends/django.py" in render 
    66.    return self.template.render(context) 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/template/base.py" in render 
    208.      return self._render(context) 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/template/base.py" in _render 
    199.   return self.nodelist.render(context) 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/template/base.py" in render 
    994.     bit = node.render_annotated(context) 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/template/base.py" in render_annotated 
    961.    return self.render(context) 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render 
    152.   compiled_parent = self.get_parent(context) 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/template/loader_tags.py" in get_parent 
    149.   return self.find_template(parent, context) 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/template/loader_tags.py" in find_template 
    129.    template_name, skip=history, 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/template/engine.py" in find_template 
    134.       name, template_dirs=dirs, skip=skip, 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/template/loaders/base.py" in get_template 
    44.      contents, origin, origin.template_name, self.engine, 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/template/base.py" in __init__ 
    191.   self.nodelist = self.compile_nodelist() 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/template/base.py" in compile_nodelist 
    233.    return parser.parse() 

File "/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/template/base.py" in parse 
    518.      raise self.error(token, e) 

回答

2

幾乎不可能知道你已經寫了什麼,但很可能你升級了過時的模板標籤功能(load ... from future),你需要通過升級包含它們的軟件包或者更新模板到加載標籤中不再有from future

+0

你知道我從哪裏開始搜索模板嗎? –

+0

我在下列文件中注意到了__ future __:/usr/share/str8RED-virtualenv/local/lib/python2.7/site-packages/django/template/base.py –

+0

不,這是一個單獨的Python事物。它不應該在Django裏面,問題可能是你的應用程序代碼。 – dreamriver