annotate gpp/urls.py @ 509:248dd8dd67f8

For #237, use Redis as the source of posts for the RSS feeds to hopefully eliminate some slow queries.
author Brian Neal <bgneal@gmail.com>
date Wed, 07 Dec 2011 01:08:54 +0000
parents 3b30286adba5
children 51fa1e0ca218
rev   line source
gremmie@1 1 from django.conf.urls.defaults import *
bgneal@6 2 from django.conf import settings
gremmie@1 3 from django.contrib import admin
bgneal@177 4 from django.views.decorators.cache import cache_page
bgneal@170 5
bgneal@415 6 from haystack.views import search_view_factory
bgneal@219 7
gremmie@1 8 from news.feeds import LatestNewsFeed
bgneal@170 9 from forums.feeds import ForumsFeed
bgneal@469 10 from custom_search.forms import CustomModelSearchForm
gremmie@1 11
bgneal@141 12
gremmie@1 13 admin.autodiscover()
gremmie@1 14
gremmie@1 15 urlpatterns = patterns('',
bgneal@19 16 url(r'^$', 'views.home', name='home'),
gremmie@1 17 (r'^admin/doc/', include('django.contrib.admindocs.urls')),
gremmie@1 18 (r'^admin/', include(admin.site.urls)),
gremmie@1 19 (r'^accounts/', include('accounts.urls')),
bgneal@215 20 (r'^antispam/', include('antispam.urls')),
gremmie@1 21 (r'^calendar/', include('gcalendar.urls')),
gremmie@1 22 (r'^comments/', include('comments.urls')),
gremmie@1 23 (r'^contact/', include('contact.urls')),
bgneal@127 24 (r'^core/', include('core.urls')),
bgneal@35 25 (r'^donations/', include('donations.urls')),
gremmie@1 26 (r'^downloads/', include('downloads.urls')),
bgneal@176 27 url(r'^feeds/news/$',
bgneal@177 28 cache_page(LatestNewsFeed(), 6 * 60 * 60),
bgneal@176 29 name='feeds-news'),
bgneal@176 30 url(r'^feeds/forums/$',
bgneal@509 31 cache_page(ForumsFeed(), 5 * 60),
bgneal@176 32 {'forum_slug': None},
bgneal@176 33 'feeds-forum_combined'),
bgneal@176 34 url(r'^feeds/forums/(?P<forum_slug>[\w\d-]+)/$',
bgneal@509 35 cache_page(ForumsFeed(), 5 * 60),
bgneal@176 36 name='feeds-forum'),
bgneal@81 37 (r'^forums/', include('forums.urls')),
gremmie@1 38 (r'^irc/', include('irc.urls')),
gremmie@1 39 (r'^links/', include('weblinks.urls')),
gremmie@1 40 (r'^member_map/', include('membermap.urls')),
gremmie@1 41 (r'^messages/', include('messages.urls')),
gremmie@1 42 (r'^news/', include('news.urls')),
bgneal@285 43 (r'^oembed/', include('oembed.urls')),
gremmie@1 44 (r'^podcast/', include('podcast.urls')),
gremmie@1 45 (r'^polls/', include('polls.urls')),
gremmie@1 46 (r'^potd/', include('potd.urls')),
gremmie@1 47 (r'^profile/', include('bio.urls')),
gremmie@1 48 (r'^shout/', include('shoutbox.urls')),
bgneal@12 49 (r'^smiley/', include('smiley.urls')),
bgneal@323 50 (r'^ygroup/', include('ygroup.urls')),
gremmie@1 51 )
gremmie@1 52
bgneal@219 53 # Haystack search views
bgneal@219 54 urlpatterns += patterns('haystack.views',
bgneal@415 55 url(r'^search/$',
bgneal@438 56 search_view_factory(form_class=CustomModelSearchForm, load_all=True),
bgneal@219 57 name='haystack_search'),
bgneal@219 58 )
bgneal@219 59
bgneal@219 60
gremmie@1 61 if settings.DEBUG:
bgneal@325 62 urlpatterns += patterns('',
bgneal@325 63 (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
gremmie@1 64 )