1 from django.conf.urls import patterns, include, url
2 from django.conf import settings
3 from words.views import HomeView, WordView
5 urlpatterns = patterns('',
6 url(r'^$', HomeView.as_view(), name='home'),
9 # Admin stuff, if necessary.
10 if 'django.contrib.admin' in settings.INSTALLED_APPS:
11 from django.contrib import admin
14 urlpatterns += patterns('',
15 url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
16 url(r'^admin/', include(admin.site.urls)),
17 url(r'^about/', include('django.contrib.flatpages.urls')),
20 urlpatterns += patterns('',
21 url(r'^(?P<slug>[^/]+)/$', WordView.as_view(), name='words_word'),
24 # Auth stuff, if necessary
25 if 'django_cas' in settings.INSTALLED_APPS:
26 urlpatterns += patterns('',
27 (r'^accounts/login/$', 'django_cas.views.login'),
28 (r'^accounts/logout/$', 'django_cas.views.logout'),
33 urlpatterns += patterns('',
34 url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
35 'document_root': settings.MEDIA_ROOT,