comparison gpp/urls.py @ 219:26ee684c2033

Initial commit of Haystack search integration. See #51.
author Brian Neal <bgneal@gmail.com>
date Sat, 05 Jun 2010 20:46:52 +0000
parents 8c1832b9d815
children 71fd8454688b
comparison
equal deleted inserted replaced
218:6dbb8faef085 219:26ee684c2033
1 from django.conf.urls.defaults import * 1 from django.conf.urls.defaults import *
2 from django.conf import settings 2 from django.conf import settings
3 from django.contrib import admin 3 from django.contrib import admin
4 from django.views.decorators.cache import cache_page 4 from django.views.decorators.cache import cache_page
5
6 from haystack.views import SearchView, search_view_factory
5 7
6 from news.feeds import LatestNewsFeed 8 from news.feeds import LatestNewsFeed
7 from forums.feeds import ForumsFeed 9 from forums.feeds import ForumsFeed
8 10
9 11
43 (r'^profile/', include('bio.urls')), 45 (r'^profile/', include('bio.urls')),
44 (r'^shout/', include('shoutbox.urls')), 46 (r'^shout/', include('shoutbox.urls')),
45 (r'^smiley/', include('smiley.urls')), 47 (r'^smiley/', include('smiley.urls')),
46 ) 48 )
47 49
50 # Haystack search views
51 urlpatterns += patterns('haystack.views',
52 url(r'^search/$', search_view_factory(view_class=SearchView, load_all=False),
53 name='haystack_search'),
54 )
55
56
48 if settings.DEBUG: 57 if settings.DEBUG:
49 urlpatterns += patterns('', 58 urlpatterns += patterns('',
50 (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), 59 (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
51 ) 60 )