urls.py 1.87 KB
Newer Older
Daniel W Bond's avatar
Daniel W Bond committed
1
from django.conf.urls import patterns, include, url
Daniel W Bond's avatar
Daniel W Bond committed
2
from django.views.generic import TemplateView
Jean Michel Rouly's avatar
Jean Michel Rouly committed
3

Jean Michel Rouly's avatar
Jean Michel Rouly committed
4
from django.contrib import admin
Daniel W Bond's avatar
Daniel W Bond committed
5

Daniel W Bond's avatar
Daniel W Bond committed
6
# FIX SEARCH #
Daniel W Bond's avatar
Daniel W Bond committed
7
#from core.forms import StyledSearchForm
8
from haystack.views import SearchView
Jean Michel Rouly's avatar
Jean Michel Rouly committed
9
10

# Uncomment the next two lines to enable the admin:
Jean Michel Rouly's avatar
Jean Michel Rouly committed
11
admin.autodiscover()
Jean Michel Rouly's avatar
Jean Michel Rouly committed
12

Daniel W Bond's avatar
Daniel W Bond committed
13
14
handle404 = TemplateView.as_view(template_name="404.html")
handle500 = TemplateView.as_view(template_name="500.html")
15

Daniel W Bond's avatar
Daniel W Bond committed
16
urlpatterns = patterns('',
17
18

    # app-level urls
Daniel W Bond's avatar
Daniel W Bond committed
19
    url(r'^share/', include('trades.urls')),
Daniel W Bond's avatar
Daniel W Bond committed
20
    url(r'^student/', include('core.urls')),
21
22
    # student urls?

Jean Michel Rouly's avatar
Jean Michel Rouly committed
23
    #### USER PAGES ####
Daniel W Bond's avatar
Daniel W Bond committed
24
    # home page
Daniel W Bond's avatar
Daniel W Bond committed
25
    url(r'^$', TemplateView.as_view(template_name='index.html'), name = 'homepage'),
26
    # create lookout
Daniel W Bond's avatar
Daniel W Bond committed
27
    url(r'^u/(?P<username>\w+)/create-lookout/?$', 'lookouts.views.create_lookout', name = 'create_lookout'),
28
29

    #### LISTING PAGES ####
Jean Michel Rouly's avatar
Jean Michel Rouly committed
30
    # book listing page
31
    url(r'^listings/(?P<book_id>\d+)$', 'trades.views.view_listing', name = 'view_listing'),
32

33
    #### STATIC PAGES ####
Jean Michel Rouly's avatar
Jean Michel Rouly committed
34
    # about page
Daniel W Bond's avatar
Daniel W Bond committed
35
    url(r'^about/?$', TemplateView.as_view(template_name='about.html'), name='about'),
36
    # privacy policy
Daniel W Bond's avatar
Daniel W Bond committed
37
    url(r'^privacy/?$', TemplateView.as_view(template_name='privacy.html'), name='privacy'),
38
    # privacy opt-out (for piwik)
Daniel W Bond's avatar
Daniel W Bond committed
39
    url(r'^privacy/opt-out/?$', 'core.views.privacy_opt_out', name='privacy_opt_out'),
40

41
    #### SEARCH PAGES ####
Jean Michel Rouly's avatar
Jean Michel Rouly committed
42
    # points to a SearchView Instance
43
    #url(r'^search/', include('haystack.urls')),
Daniel W Bond's avatar
Daniel W Bond committed
44
45
46
47
48
49
50
51
    #url(
    #    r'^search/?',
    #    SearchView(
    #        form_class = StyledSearchForm,
    #        results_per_page = 20,
    #    ),
    #    name = 'haystack_search',
    #),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
52

Daniel W Bond's avatar
Daniel W Bond committed
53
54
55
    url(r'^login/$', 'cas.views.login', name='login'),
    url(r'^logout/$', 'cas.views.logout', name='logout'),

Jean Michel Rouly's avatar
Jean Michel Rouly committed
56
    #### ADMIN PAGES ####
Daniel W Bond's avatar
Daniel W Bond committed
57
    #url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
58
    url(r'^admin/', include(admin.site.urls)),
59

Jean Michel Rouly's avatar
Jean Michel Rouly committed
60
)