fix banner
[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 .views import HomeView, AvatarlessProfileEditView
5
6
7 urlpatterns = patterns(
8     '',
9     url(r'^$', HomeView.as_view(), name="home"),
10     url(r'^lekcje/', include('catalogue.urls')),
11     url(r'^info/(?P<url>.*)$', 'django.contrib.flatpages.views.flatpage',
12         name="info"),
13     url(r'^szukaj/', include('haystack.urls')),
14     url(r'^zglos/', include('contact.urls')),
15     url(r'^forum/profile/edit/$', AvatarlessProfileEditView.as_view(), name='edit_profile'),
16     url(r'^forum/', include('forum.urls')),
17     url(r'^forum/', include('pybb.urls', namespace='pybb')),
18     url(r'^kompetencje/', include('curriculum.urls')),
19     url(r'^wtem/', include('wtem.urls')),
20 )
21
22
23 # Admin stuff, if necessary.
24 if 'django.contrib.admin' in settings.INSTALLED_APPS:
25     from django.contrib import admin
26     admin.autodiscover()
27
28     if 'django_cas' in settings.INSTALLED_APPS:
29         urlpatterns += patterns(
30             '',
31             (r'^admin/logout/$', 'django_cas.views.logout'),
32         )
33     urlpatterns += patterns(
34         '',
35         url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
36         url(r'^admin/', include(admin.site.urls)),
37     )
38
39 # Auth stuff, if necessary
40 if 'django_cas' in settings.INSTALLED_APPS:
41     urlpatterns += patterns(
42         '',
43         url(r'^accounts/login/$', 'django_cas.views.login', name='login'),
44         url(r'^accounts/logout/$', 'django_cas.views.logout', name='logout'),
45     )
46
47
48 if settings.DEBUG:
49     from fnpdjango.utils.urls import i18n_patterns
50     from .views import mil_home_view, mil_contact_view, mil_knowledge_base_view
51     urlpatterns += i18n_patterns(
52         '',
53         url(r'^katalog/$', mil_home_view, name="mil_home"),
54         url(r'^wez-udzial/', include('comment.urls')),
55         url(r'^kontakt/$', mil_contact_view, name='mil_contact'),
56         url(r'^bazawiedzy/(?P<url>.*)$', mil_knowledge_base_view, name="knowledge_base"),
57     )
58
59
60 if settings.DEBUG:
61     urlpatterns += patterns(
62         '',
63         url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
64             'document_root': settings.MEDIA_ROOT,
65         }),
66     )