0e5c2954c4b6b72e684a74c8933983228f76e424
[edumed.git] / edumed / urls.py
1 # -*- coding: utf-8 -*-
2 from django.conf.urls import patterns, include, url
3 from django.conf import settings
4 from django.contrib.flatpages.views import flatpage
5 # from django.shortcuts import redirect
6
7 # from .views import HomeView, AvatarlessProfileEditView, flatpage_with_template
8
9 urlpatterns = patterns(
10     '',
11     # url(r'^$', HomeView.as_view(), name="home"),
12     # url(r'^lekcje/', include('catalogue.urls')),
13     # url(r'^info/turniej/(?P<url>.*)$', lambda request, url: redirect('olimpiada', url)),
14     # url(r'^info/(?P<url>.*)$', flatpage, name="info"),
15     # url(r'^olimpiada/$', lambda request: flatpage(request, 'turniej/'), name='olimpiada'),
16     # url(r'^olimpiada/(?P<url>.*)$', lambda request, url: flatpage(request, 'turniej/' + url), name='olimpiada'),
17     url(r'^szukaj/', include('haystack.urls')),
18
19     # url(r'^olimpiada-teaser/(?P<url>.*)$',
20     #     lambda request, url: flatpage_with_template(request, 'turniej/' + url, 'olimpiada_teaser.html'),
21     #     name='olimpiada_teaser'),
22
23     url(r'^zglos/', include('contact.urls')),
24     # url(r'^forum/profile/edit/$', AvatarlessProfileEditView.as_view(), name='edit_profile'),
25     # url(r'^forum/', include('forum.urls')),
26     # url(r'^forum/', include('pybb.urls', namespace='pybb')),
27     # url(r'^kompetencje/', include('curriculum.urls')),
28     url(r'^zadania/', include('wtem.urls')),
29     url(r'^2etap/', include('stage2.urls')),
30 )
31
32
33 # Admin stuff, if necessary.
34 if 'django.contrib.admin' in settings.INSTALLED_APPS:
35     from django.contrib import admin
36     admin.autodiscover()
37
38     if 'django_cas' in settings.INSTALLED_APPS:
39         urlpatterns += patterns(
40             '',
41             (r'^admin/logout/$', 'django_cas.views.logout'),
42         )
43     urlpatterns += patterns(
44         '',
45         url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
46         url(r'^admin/', include(admin.site.urls)),
47     )
48
49 # Auth stuff, if necessary
50 if 'django_cas' in settings.INSTALLED_APPS:
51     urlpatterns += patterns(
52         '',
53         url(r'^accounts/login/$', 'django_cas.views.login', name='login'),
54         url(r'^accounts/logout/$', 'django_cas.views.logout', name='logout'),
55     )
56
57 urlpatterns += (
58     url(r'^(?P<url>[^/]*/|)$',
59         lambda request, url: flatpage(request, 'turniej/' + url)),
60 )
61
62 if settings.DEBUG:
63     urlpatterns += patterns(
64         '',
65         # url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
66         #     'document_root': settings.MEDIA_ROOT,
67         # }),
68     )