Pythonanywhere'staticfiles'不是有效的标记库:找不到模板库staticfiles

Vya*_*Rao 3 python django django-staticfiles pythonanywhere

在pythonanywhere中,我正在使用带有Django 1.7和Python 2.7的virtualenv

Settings.py

STATIC_ROOT = '/home/movies/pantherlist/movies/static/'
STATIC_URL = '/static/'

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'pantherlist.movies',
)
Run Code Online (Sandbox Code Playgroud)

wsgi.py

activate_this = '/home/movies/.virtualenvs/django17/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
.
.#path setup already done here
.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Run Code Online (Sandbox Code Playgroud)

我收到了错误

异常类型:TemplateSyntaxError异常值:
'staticfiles'不是有效的标记库:找不到模板库staticfiles,尝试过django.templatetags.staticfiles,django.contrib.admin.templatetags.staticfiles

异常位置:/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py in load,1054行

index.html出错

{% load staticfiles %}
Run Code Online (Sandbox Code Playgroud)

请帮忙.提前致谢.

Gle*_*enn 5

看起来您没有重新加载您的Web应用程序,因为将virtualenv激活添加到您的wsgi文件,或者您没有使用您认为正在使用的wsgi文件.Django报告的错误位置(/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py)位于PythonAnywhere上的默认系统Django中,而不是virtualenv中的Django.