urls.py 2.22 KB
Newer Older
Jean Michel Rouly's avatar
Jean Michel Rouly committed
1
2
3
4
5
## DEVELOPMENT IMPORTS
from django.conf import settings
from django.conf.urls.static import static
## DEVELOPMENT IMPORTS

Jean Michel Rouly's avatar
Jean Michel Rouly committed
6
from django.contrib import admin
Jean Michel Rouly's avatar
Jean Michel Rouly committed
7
from django.contrib import auth
Jean Michel Rouly's avatar
Jean Michel Rouly committed
8
from django.conf.urls import patterns, include, url
9
10
from website.forms import StyledSearchForm
from haystack.views import SearchView
Jean Michel Rouly's avatar
Jean Michel Rouly committed
11
12

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

15
16
17
handle404 = "error_404"
handle500 = "error_500"

Jean Michel Rouly's avatar
Jean Michel Rouly committed
18
urlpatterns = patterns('website.views',
Jean Michel Rouly's avatar
Jean Michel Rouly committed
19
    #### USER PAGES ####
Daniel W Bond's avatar
Daniel W Bond committed
20
21
    # home page
    url(r'^$', 'index', name = 'homepage'),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
22
    # user profile page
Jean Michel Rouly's avatar
Jean Michel Rouly committed
23
    url(r'^u/(?P<username>\w+)/?$', 'profile', name = 'profile'),
24
25
26
27
28
29
30
31
    # create lookout
    url(r'^u/(?P<username>\w+)/create-lookout/?$', 'create_lookout', name = 'create_lookout'),

    #### LISTING PAGES ####
    # global new listings page
    url(r'^listings/?$', 'all_listings', name = 'all_listings'),
    # create new listing
    url(r'^listings/create/?$', 'create_listing', name = 'create_listing'),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
32
    # book listing page
33
    url(r'^listings/(?P<book_id>\d+)$', 'view_listing', name = 'view_listing'),
34

35
    #### STATIC PAGES ####
Jean Michel Rouly's avatar
Jean Michel Rouly committed
36
37
    # about page
    url(r'^about/?$', 'about', name = 'about'),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
38
39
    # contact staff
    url(r'^contact/?$', 'contact', name = 'contact'),
40
41
    # privacy policy
    url(r'^privacy/?$', 'privacy', name = 'privacy'),
42
43
    # privacy opt-out (for piwik)
    url(r'^privacy/opt-out/?$', 'privacy_opt_out', name='privacy_opt_out'),
44

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

Jean Michel Rouly's avatar
Jean Michel Rouly committed
57
    #### ADMIN PAGES ####
Jean Michel Rouly's avatar
Jean Michel Rouly committed
58
    # Uncomment the admin/doc line below to enable admin documentation:
Jean Michel Rouly's avatar
Jean Michel Rouly committed
59
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
60
    # Uncomment the next line to enable the admin:
Jean Michel Rouly's avatar
Jean Michel Rouly committed
61
    url(r'^admin/', include(admin.site.urls)),
62

Jean Michel Rouly's avatar
Jean Michel Rouly committed
63
64
)

Jean Michel Rouly's avatar
Jean Michel Rouly committed
65
66
67
68
69
urlpatterns += patterns('django.contrib.auth.views',
    #### AUTH PAGES ####
    url(r'^login$', 'login', {'template_name': 'login.html'},
        name='website_login'),
    url(r'^logout$', 'logout', {'next_page': '/'}, name='website_logout'),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
70
)