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