urls.py 2.27 KB
Newer Older
fred's avatar
fred committed
1
from django.conf.urls import patterns, include, url
fred's avatar
fred committed
2
3
from django.conf import settings

fred's avatar
fred committed
4
5
6
7
8
9
10
11
from django.views.generic import RedirectView
from django.core.urlresolvers import reverse_lazy

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', 'panikweb.views.home', name='home'),
fred's avatar
fred committed
12
    url(r'^onair.json$', 'panikweb.views.onair', name='onair'),
Simon Daron's avatar
Simon Daron committed
13
14
    url(r'^program/$', 'panikweb.views.program', name='program'),
    url(r'^program/(?P<year>\d{4})/(?P<week>\d+)/$', 'panikweb.views.program', name='program_week'),
Simon Daron's avatar
Simon Daron committed
15
    url(r'^grid$', 'panikweb.views.grid', name='grid'),
Simon Daron's avatar
Simon Daron committed
16
    url(r'^emissions/$', 'panikweb.views.emissions', name='emissions'),
17
    url(r'^emissions/(?P<slug>[\w,-]+)/episodes/$', 'panikweb.views.emissionEpisodes', name='emissionEpisodes'),
18
    url(r'^emissions/(?P<emission_slug>[\w,-]+)/(?P<slug>[\w,-]+)/$', 'panikweb.views.episode', name='episode-view'),
19
    url(r'^emissions/(?P<slug>[\w,-]+)/$', 'panikweb.views.emission', name='emission-view'),
fred's avatar
fred committed
20
    url(r'^ckeditor/', include('ckeditor.urls')),
21
    url(r'^emissions/archives$', 'panikweb.views.emissionsArchives', name='emissionsArchives'),
fred's avatar
fred committed
22
    url(r'^listen/$', 'panikweb.search.listenArchives', name='listen'),
fred's avatar
fred committed
23
    url(r'^news/$', 'panikweb.views.news', name='news'),
24
    url(r'^news/archives/$', 'panikweb.views.newsArchives', name='newsArchives'),
Simon Daron's avatar
Simon Daron committed
25
    url(r'^news/(?P<slug>[\w,-]+)$', 'panikweb.views.newsitemview', name='news-view'),
fred's avatar
fred committed
26

fred's avatar
fred committed
27
28
    url(r'^search/', 'panikweb.search.view', name='search'),

fred's avatar
fred committed
29
30
    url(r'^podcasts.rss', 'panikweb.views.podcasts_feed', name='podcasts-feed'),

fred's avatar
fred committed
31
    url(r'^newsletter/', include('newsletter.urls')),
fred's avatar
fred committed
32
33
34
35
    (r'^api/v2/', include('fiber.rest_api.urls')),
    (r'^admin/fiber/', include('fiber.admin_urls')),
    (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', {'packages': ('fiber',),}),

fred's avatar
fred committed
36
37
38
39
40
41
42
    url(r'^admin/', include(admin.site.urls)),
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
)

from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns += staticfiles_urlpatterns()

fred's avatar
fred committed
43
44
45
from django.conf.urls.static import static
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

fred's avatar
fred committed
46
urlpatterns += patterns('',
fred's avatar
fred committed
47
    (r'', 'panikweb.views.fiber_page'),
fred's avatar
fred committed
48
49
)

fred's avatar
fred committed
50
51
52
53
try:
    from local_urls import *
except ImportError, e:
    pass