urls.py 1.71 KB
Newer Older
Daniel Warren Bond's avatar
Daniel Warren Bond committed
1
2
3
4
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()

Daniel W Bond's avatar
Daniel W Bond committed
5
urlpatterns = patterns('trajectories.views',
Daniel Warren Bond's avatar
Daniel Warren Bond committed
6
7
8
9
    # Examples:
    # url(r'^$', 'advisor.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

Daniel W Bond's avatar
urls    
Daniel W Bond committed
10
11
12
13
14
15
16
17
18
    # URL Schema:
    # /                - homepage
    # /about           - about page
    # /course/XX       - course page
    # /user/XX         - student page
    # /user/XX/create  - student's create traj. page
    # /user/XX/compare - student's compare tool
    # /admin           - administrator portal

Daniel W Bond's avatar
Daniel W Bond committed
19
20
21
    # homepage
    url(r'^$', 'index', name = 'homepage'),

22
23
24
    # log in
    url(r'^login/$', 'login', name = 'login'),

Daniel W Bond's avatar
urls    
Daniel W Bond committed
25
26
    # about page
    url(r'^about/$', 'about', name = 'about'),
Daniel W Bond's avatar
Daniel W Bond committed
27

Daniel W Bond's avatar
Daniel W Bond committed
28
    # course
29
    url(r'^course/(?P<courseName>\w+)/$', 'course', name = 'course'),
Daniel W Bond's avatar
Daniel W Bond committed
30
31

    # student's page
32
    url(r'^user/(?P<username>\w+)/$', 'student', name = 'student'),
Daniel W Bond's avatar
Daniel W Bond committed
33

34
35
36
    # single trajectory page
    url(r'^user/(?P<username>\w+)/(?P<trajectoryslug>\w+)$', 'trajectory', name = 'trajectory'),

Daniel W Bond's avatar
urls    
Daniel W Bond committed
37
    # creating the trajectory
38
    # url(r'^user/(?P<username>\w+)/create/$', 'create', name = 'create'),
39
    url(r'^create/$', 'create', name = 'create'),
Daniel W Bond's avatar
Daniel W Bond committed
40

Daniel W Bond's avatar
urls    
Daniel W Bond committed
41
    # comparison page
42
43
    # url(r'^user/(?P<username>\w+)/compare/$', 'compare', name = 'compare'),
    url(r'^compare/$', 'compare', name = 'compare'),
Daniel W Bond's avatar
Daniel W Bond committed
44

45
    # admin pages
Daniel Warren Bond's avatar
Daniel Warren Bond committed
46
    url(r'^admin/', include(admin.site.urls)),
Daniel W Bond's avatar
Daniel W Bond committed
47
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
Daniel Warren Bond's avatar
Daniel Warren Bond committed
48
)
49
50
51
52
53
54
55

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'),
)