urls.py 1.91 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
    # Examples:
18
19
20
    # url(r'^$', 'bookshare.views.home', name='home'),
    # url(r'^bookshare/', include('bookshare.foo.urls')),

Jean Michel Rouly's avatar
Jean Michel Rouly committed
21
    #### USER PAGES ####
Daniel W Bond's avatar
Daniel W Bond committed
22
23
    # home page
    url(r'^$', 'index', name = 'homepage'),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
24
    # user profile page
Jean Michel Rouly's avatar
Jean Michel Rouly committed
25
    url(r'^u/(?P<username>\w+)/?$', 'profile', name = 'profile'),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
26
    # book listing page
Jean Michel Rouly's avatar
Jean Michel Rouly committed
27
    url(r'^u/(?P<username>\w+)/listings/(?P<book_id>\w+)$', 'listing', name = 'listing'),
28

29
    #### STATIC PAGES ####
Jean Michel Rouly's avatar
Jean Michel Rouly committed
30
31
    # about page
    url(r'^about/?$', 'about', name = 'about'),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
32
33
    # contact staff
    url(r'^contact/?$', 'contact', name = 'contact'),
34
35
36
    # privacy policy
    url(r'^privacy/?$', 'privacy', name = 'privacy'),

Jean Michel Rouly's avatar
Jean Michel Rouly committed
37
38
39
    #### LISTING MANAGEMENT PAGES ####
    # create new listing
    url(r'^create/?$', 'create_listing', name = 'create_listing'),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
40

41
42
43
44
    #### LOOKOUT MANAGEMENT PAGES ####
    # create and manage lookouts
    url(r'^lookouts/?$', 'lookouts', name = 'lookouts'),

Jean Michel Rouly's avatar
Jean Michel Rouly committed
45
46
47
48
    #### SEARCHES ####
    # points to a SearchView Instance
    url(r'^search/', include('haystack.urls')),

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

Jean Michel Rouly's avatar
Jean Michel Rouly committed
55
56
)

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