码迷,mamicode.com
首页 > 其他好文 > 详细

django 访问静态资源

时间:2017-06-30 11:11:49      阅读:98      评论:0      收藏:0      [点我收藏+]

标签:ann   url   stat   访问   document   static   view   color   class   

urlpatterns = patterns(‘‘,
         url(r‘^$‘, views.show, name=‘index‘),
         url(r‘^static/(?P<path>.*)‘, ‘django.views.static.serve‘, {‘document_root‘:‘/home/anna/Documents/django_py/showImg/static‘}),
         )              

当url 以 static/开头是 ,访问静态资源

django 访问静态资源

标签:ann   url   stat   访问   document   static   view   color   class   

原文地址:http://www.cnblogs.com/whm-blog/p/7097721.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!