配置 app urls
项目下的urls.py from django.conf.urls import url,include urlpatterns = [ url(r'^BookApp/', include('BookApp.urls')), ] app下的urls.py from django.conf.urls import url from . import views urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^indexBook/$', views.indexBook), ] 访问时应该是访问 /BookApp/indexBook/
配置app static
STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'BookApp', 'static') ]
调用方法(前面不用加BookApp):
<link rel="stylesheet" href="/static/plugins/bootstrap/css/bootstrap.min.css">
static目录结构