urls.py 1.98 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
9
10
from django.conf.urls import patterns, include, url

# 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

13
14
15
handle404 = "error_404"
handle500 = "error_500"

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

43
    #### SEARCH PAGES ####
Jean Michel Rouly's avatar
Jean Michel Rouly committed
44
45
46
    # points to a SearchView Instance
    url(r'^search/', include('haystack.urls')),

Jean Michel Rouly's avatar
Jean Michel Rouly committed
47
    #### ADMIN PAGES ####
Jean Michel Rouly's avatar
Jean Michel Rouly committed
48
    # Uncomment the admin/doc line below to enable admin documentation:
Jean Michel Rouly's avatar
Jean Michel Rouly committed
49
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
50
    # Uncomment the next line to enable the admin:
Jean Michel Rouly's avatar
Jean Michel Rouly committed
51
    url(r'^admin/', include(admin.site.urls)),
52

Jean Michel Rouly's avatar
Jean Michel Rouly committed
53
54
)

Jean Michel Rouly's avatar
Jean Michel Rouly committed
55
56
57
58
59
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
60
)