forked from przem8k/piosenka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
urls.py
39 lines (34 loc) · 1.45 KB
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from django.conf.urls.defaults import *
from django.contrib import admin
from django.views.generic import TemplateView, RedirectView
import songs.views
import frontpage.views
import users.views
admin.autodiscover()
urlpatterns = patterns('',
#obsolete paths redicrects
url(r'^songs/song/(?P<song_id>\d+)/$', songs.views.obsolete_song),
url(r'^songs/artist/(?P<artist_id>\d+)/$', songs.views.obsolete_artist),
url(r'^songs/band/(?P<band_id>\d+)/$', songs.views.obsolete_band),
#site sections
url(r'^spiewnik/', include('songs.urls')),
url(r'^blog/', include('blog.urls')),
url(r'^wydarzenia/', include('events.urls')),
url(r'^o-stronie/$', TemplateView.as_view(template_name="about.html")),
url(r'^about/$', RedirectView.as_view(url="/o-stronie/")),
url(r'^facebook/$', RedirectView.as_view(url="/o-stronie/")),
#users
url(r'^zaloguj/$', users.views.hello),
#admin
url(r'^admin/', include(admin.site.urls)),
#index
url(r'^$', frontpage.views.IndexView.as_view(), name="index"),
)
from django.conf import settings
if settings.DEBUG:
urlpatterns = patterns('',
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
) + patterns('',
(r'^500/$', 'django.views.generic.simple.direct_to_template', {'template': '500.html'}),
(r'^404/$', 'django.views.generic.simple.direct_to_template', {'template': '404.html'}),
) + urlpatterns