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/开头是 ,访问静态资源
时间: 2024-11-05 20:37:41
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/开头是 ,访问静态资源