报错如下:
解决方法:
在settings.py加上
'libraries': { # Adding this section should work around the issue.
'staticfiles': 'django.templatetags.static'}
加上之后如下,即可成功访问了~
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',
],
'libraries': { # Adding this section should work around the issue.
'staticfiles': 'django.templatetags.static',
},
},
},
]
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)