1.debug=True状态下 我们可以看到mysql查询语句的打印,如何不显示这些打印呢
2.setting修改一下内容
DEBUG = False if DEBUG is True: STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),) else: STATIC_ROOT = os.path.join(BASE_DIR, 'static') ALLOWED_HOSTS = ['*']
3.路由下添加以下内容
from django.views import static from django.conf import settings from django.conf.urls import url ##新增 urlpatterns += [ url(r'^static/(?P<path>.*)$', static.serve, {'document_root': settings.STATIC_ROOT }, name='static'), ]
标签:静态,django,static,conf,debug,import,DIR From: https://www.cnblogs.com/wusenwusen/p/16994570.html