- urlpatterns += patterns('',
- (r'^accounts/login/$', 'django_cas.views.login'),
- (r'^accounts/logout/$', 'django_cas.views.logout'),
- )
-
-
-if settings.DEBUG:
- urlpatterns += patterns('',
- url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
- 'document_root': settings.MEDIA_ROOT,
- }),
- )
+ urlpatterns += [
+ url(r'^accounts/login/$', 'django_cas.views.login', name='login'),
+ url(r'^accounts/logout/$', 'django_cas.views.logout', name='logout'),
+ ]
+else:
+ from django.contrib.auth.views import login, logout
+ urlpatterns += [
+ url(r'^accounts/login/$', login, name='login'),
+ url(r'^accounts/logout/$', logout, name='logout'),
+ ]
+
+urlpatterns += (
+ url(r'^(?P<url>[^/]*/|)$',
+ lambda request, url: flatpage(request, 'turniej/' + url)),
+)