c579b397b937ceeaafcba86acbb82fed4c3ed596
[fnp-django-template.git] / src / src / project_name / urls.py
1 from django.conf.urls import patterns, include, url
2 from django.conf import settings
3
4 urlpatterns = patterns('',
5     # Examples:
6     # url(r'^$', '{{ project_name }}.views.home', name='home'),
7     # url(r'^{{ project_name }}/', include('foo.urls')),
8 )
9
10
11 # Admin stuff, if necessary.
12 if 'django.contrib.admin' in settings.INSTALLED_APPS:
13     from django.contrib import admin
14     admin.autodiscover()
15
16     urlpatterns += patterns('',
17         url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
18         url(r'^admin/', include(admin.site.urls)),
19     )
20
21 # Auth stuff, if necessary
22 if 'django_cas' in settings.INSTALLED_APPS:
23     urlpatterns += patterns('',
24         (r'^accounts/login/$', 'django_cas.views.login'),
25         (r'^accounts/logout/$', 'django_cas.views.logout'),
26     )
27
28 # Media in DEBUG mode
29 if settings.DEBUG:
30     urlpatterns += patterns('',
31         url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
32             'document_root': settings.MEDIA_ROOT,
33         }),
34    )