19944142416209cc071bccd5e081826f410c7bca
[wolnelektury.git] / wolnelektury / urls.py
1 # -*- coding: utf-8 -*-
2 import os
3
4 from django.conf.urls.defaults import *
5 from django.conf import settings
6 from django.contrib import admin
7
8 from catalogue.forms import SearchForm
9
10
11 admin.autodiscover()
12
13
14 urlpatterns = patterns('',
15     url(r'^katalog/', include('catalogue.urls')),
16     
17     # Static pages
18     url(r'^wolontariat/$', 'django.views.generic.simple.direct_to_template', 
19         {'template': 'info/voluntary_services.html', 'extra_context': {'form': SearchForm()}},
20         name='voluntary_services'),
21     url(r'^mozesz-nam-pomoc/$', 'django.views.generic.simple.direct_to_template',
22         {'template': 'info/help_us.html', 'extra_context': {'form': SearchForm()}},
23         name='help_us'),
24     url(r'^o-projekcie/$', 'django.views.generic.simple.direct_to_template', 
25         {'template': 'info/about_us.html', 'extra_context': {'form': SearchForm()}},
26         name='about_us'),
27     
28     # Admin panel
29     url(r'^admin/catalogue/book/import$', 'catalogue.views.import_book', name='import_book'),
30     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
31     url(r'^admin/(.*)$', admin.site.root),
32     
33     # Authentication
34     url(r'^uzytkownicy/zaloguj/$', 'catalogue.views.login', name='login'),
35     url(r'^uzytkownicy/wyloguj/$', 'catalogue.views.logout_then_redirect', name='logout'),
36     url(r'^uzytkownicy/utworz/$', 'catalogue.views.register', name='register'),
37     
38     # Static files
39     url(r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:], 'django.views.static.serve', 
40         {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
41     url(r'^%s(?P<path>.*)$' % settings.STATIC_URL[1:], 'django.views.static.serve',
42         {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
43     url(r'^$', 'django.views.generic.simple.redirect_to', {'url': 'katalog/'}),
44 )