django网站中二级目录下的网页打开后没有CSS样式
不是admin后台的样式(这个网上有解决问题)。
而是这样比如:abc.com/blog/create或abc.com/news/add这样在create和add页面中没有css样式,我觉得是urls.py的问题,但不知具体怎么错了,代码如下,有一个主目录urls.py,另外两个是blog和news应用下的urls.py文件
// 主目录的urls.py
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.auth.views import login,logout
urlpatterns = patterns('',
# Examples:
url(r'^blog/', include('blog.urls')),
url(r'^news/',include('news.urls')),
)
//news/urls.py
from django.conf.urls import patterns, include, url
urlpatterns = patterns('news.views',
url(r'^$','news_list'),
url(r'add/$','add_news'),
)
//blog/urls.py
from django.conf.urls import patterns, include, url
from blog.views import create_topic
urlpatterns = patterns('blog.views',
url(r'^$','topic_list'),
url(r'^create/$','create_topic'),
)
菊花爱好者
10 years, 3 months ago