【发布时间】:2017-12-12 19:11:56
【问题描述】:
当我尝试它给出404 error view 时,我的样式不起作用。我尝试创建自定义 404 视图,但它也不起作用。
这是我的代码。
settings.py
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ['*']
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'ran_app/templates')],
'APP_DIRS': True,
'OPTIONS': {
'debug': DEBUG,
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
STATIC_URL = '/static/'
我的模板中也有 404.html 页面。
这是浏览器错误。
加载资源失败:服务器响应状态为 404 (未找到)
【问题讨论】:
-
是否可以选择使用 CDN 作为样式?
标签: django-1.11