ff553106342436c102cdd920b24bb67e272a67a9
[edumed.git] / edumed / urls.py
1 from django.conf.urls import patterns, include, url
2 from django.conf import settings
3 from .views import HomeView, AvatarlessProfileEditView
4
5
6
7 urlpatterns = patterns('',
8     url(r'^$', HomeView.as_view(), name="home"),
9     url(r'^kompetencje/', include('curriculum.urls')),
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 )
19
20
21 # Admin stuff, if necessary.
22 if 'django.contrib.admin' in settings.INSTALLED_APPS:
23     from django.contrib import admin
24     admin.autodiscover()
25
26     if 'django_cas' in settings.INSTALLED_APPS:
27         urlpatterns += patterns('',
28             (r'^admin/logout/$', 'django_cas.views.logout'),
29         )
30     urlpatterns += patterns('',
31         url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
32         url(r'^admin/', include(admin.site.urls)),
33     )
34
35 # Auth stuff, if necessary
36 if 'django_cas' in settings.INSTALLED_APPS:
37     urlpatterns += patterns('',
38         url(r'^accounts/login/$', 'django_cas.views.login', name='login'),
39         url(r'^accounts/logout/$', 'django_cas.views.logout', name='logout'),
40     )
41
42
43 if settings.DEBUG:
44     urlpatterns += patterns('',
45         url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
46             'document_root': settings.MEDIA_ROOT,
47         }),
48    )