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)),
19 urlpatterns += patterns('',
20 url(r'^(?P<slug>[^/]+)/$', WordView.as_view(), name='words_word'),
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'),
32 urlpatterns += patterns('',
33 url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
34 'document_root': settings.MEDIA_ROOT,