urls.py 1.69 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

Jean Michel Rouly's avatar
Jean Michel Rouly committed
13
urlpatterns = patterns('website.views',
Jean Michel Rouly's avatar
Jean Michel Rouly committed
14
    # Examples:
15
16
17
    # url(r'^$', 'bookshare.views.home', name='home'),
    # url(r'^bookshare/', include('bookshare.foo.urls')),

Jean Michel Rouly's avatar
Jean Michel Rouly committed
18
    #### USER PAGES ####
Jean Michel Rouly's avatar
Jean Michel Rouly committed
19
20
21
22
23
24
    # user profile page
    url(r'^u/(?P<slug>\w+)/?$', 'profile', name = 'profile'),
    # user listings page
    url(r'^u/(?P<slug>\w+)/listings/?$', 'user_listings', name = 'user_listings'),
    # book listing page
    url(r'^u/(?P<slug>\w+)/listings/(?P<book_slug>\w+)$', 'listing', name = 'listing'),
25

Jean Michel Rouly's avatar
Jean Michel Rouly committed
26
27
28
29
30
    #### META PAGES ####
    # home page
    url(r'^$', 'index', name = 'homepage'),
    # about page
    url(r'^about/?$', 'about', name = 'about'),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
31
32
    # contact staff
    url(r'^contact/?$', 'contact', name = 'contact'),
33
34
    # privacy policy
    url(r'^privacy/?$', 'privacy', name = 'privacy'),
35
36
#    # security policy
#    url(r'^security/?$', 'security', name = 'security'),
37

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

Jean Michel Rouly's avatar
Jean Michel Rouly committed
44
    #### ADMIN PAGES ####
Jean Michel Rouly's avatar
Jean Michel Rouly committed
45
    # Uncomment the admin/doc line below to enable admin documentation:
Jean Michel Rouly's avatar
Jean Michel Rouly committed
46
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
47
    # Uncomment the next line to enable the admin:
Jean Michel Rouly's avatar
Jean Michel Rouly committed
48
    url(r'^admin/', include(admin.site.urls)),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
49
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)