forked from mirror/MrDoc
完善404页面
This commit is contained in:
parent
a8b20f7882
commit
f6829ba7f2
@ -23,7 +23,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|||||||
SECRET_KEY = '5&71mt9@^58zdg*_!t(x6g14q*@84d%ptr%%s6e0l50zs0we3d'
|
SECRET_KEY = '5&71mt9@^58zdg*_!t(x6g14q*@84d%ptr%%s6e0l50zs0we3d'
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG = False
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['*']
|
ALLOWED_HOSTS = ['*']
|
||||||
|
|
||||||
@ -122,11 +122,13 @@ USE_TZ = True
|
|||||||
# https://docs.djangoproject.com/en/2.1/howto/static-files/
|
# https://docs.djangoproject.com/en/2.1/howto/static-files/
|
||||||
|
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static/'
|
||||||
STATICFILES_DIRS = [os.path.join(BASE_DIR,'static'),]
|
if DEBUG:
|
||||||
|
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static'), ]
|
||||||
|
else:
|
||||||
|
STATIC_ROOT = os.path.join(BASE_DIR,'static')
|
||||||
|
|
||||||
# 媒体文件
|
# 媒体文件
|
||||||
MEDIA_URL = '/media/'
|
MEDIA_URL = '/media/'
|
||||||
MEDIA_ROOT = os.path.join(BASE_DIR,'media')
|
MEDIA_ROOT = os.path.join(BASE_DIR,'media')
|
||||||
|
|
||||||
# 日志配置
|
|
||||||
|
|
||||||
|
@ -22,5 +22,6 @@ urlpatterns = [
|
|||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
path('',include('app_doc.urls')),
|
path('',include('app_doc.urls')),
|
||||||
path('user/',include('app_admin.urls'),),
|
path('user/',include('app_admin.urls'),),
|
||||||
|
re_path('^static/(?P<path>.*)$',serve,{'document_root':settings.STATIC_ROOT}),# 静态文件
|
||||||
re_path('^media/(?P<path>.*)$',serve,{'document_root':settings.MEDIA_ROOT}),# 媒体文件
|
re_path('^media/(?P<path>.*)$',serve,{'document_root':settings.MEDIA_ROOT}),# 媒体文件
|
||||||
]
|
]
|
||||||
|
@ -44,8 +44,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-main">
|
<div class="layui-main">
|
||||||
<div class="project-item">
|
<div style="text-align: center;margin-top: 20px;">
|
||||||
|
<h1>
|
||||||
|
<strong>页面未找到……</strong>
|
||||||
|
</h1>
|
||||||
|
<p><a href="{% url 'pro_list' %}" >返回首页</a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user