urls.py 1.92 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
19
    #url(r'^share/', include('trades.urls')),
20
21
    # student urls?

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

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

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

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

Daniel W Bond's avatar
Daniel W Bond committed
54
55
56
    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
57
    #### ADMIN PAGES ####
Daniel W Bond's avatar
Daniel W Bond committed
58
    #url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
59
    url(r'^admin/', include(admin.site.urls)),
60

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