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