source: mauRepo/MolesManager/trunk/src/MolesManager/urls.py @ 8137

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/MolesManager/urls.py@8137
Revision 8137, 1.4 KB checked in by mnagni, 8 years ago (diff)

Updated the urls.py in order to allow a static access to css/js/img. Anyway as specified in DJANGO manual

"Django itself doesn’t serve static (media) files, such as images, style sheets, or video. It leaves that job to whichever Web server you choose.
The reasoning here is that standard Web servers, such as Apache, lighttpd and Cherokee, are much more fine-tuned at serving static files than a Web application framework."

Line 
1from django.conf.urls.defaults import patterns, url
2from MolesManager.settings import STATIC_ROOT
3
4# Uncomment the next two lines to enable the admin:
5# from django.contrib import admin
6# admin.autodiscover()
7
8urlpatterns = patterns('',
9    # Examples:
10    # url(r'^$', 'MolesManager.views.home', name='home'),
11    # url(r'^MolesManager/', include('MolesManager.foo.urls')),
12
13    # Uncomment the admin/doc line below to enable admin documentation:
14    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
15
16    # Uncomment the next line to enable the admin:
17    # url(r'^admin/', include(admin.site.urls)),
18)
19
20urlpatterns += patterns('MolesManager.views.cedaObservationView',
21
22    (r'cov/$', 'coView'),
23)
24
25urlpatterns += patterns('MolesManager.views.cedaSearch',
26
27    (r'search/$', 'coSearch'),
28)
29
30
31urlpatterns += patterns('MolesManager.views',
32    (r'^$', 'index.home'),
33)
34
35
36urlpatterns += patterns('',
37    url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': STATIC_ROOT , 'show_indexes': True}),
38)
39
40urlpatterns += patterns('',
41    url(r'^static/css', 'django.views.static.serve', {'document_root': STATIC_ROOT+'/css' , 'show_indexes': True}),
42)
43
44urlpatterns += patterns('',
45    url(r'^static/css/960/(?P<path>.*)$', 'django.views.static.serve', {'document_root': STATIC_ROOT+'/css/960' , 'show_indexes': True}),
46)
47#urlpatterns += staticfiles_urlpatterns()
Note: See TracBrowser for help on using the repository browser.