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