urls.py 1.8 KB
Newer Older
1
# core django imports
Jason D Yeomans's avatar
Jason D Yeomans committed
2
from django.conf.urls import patterns, include, url
3
from django.views.decorators.cache import cache_page
4 5
# imports from your apps
from .views import DetailStudent, UpdateStudent, DetailStudentSettings,\
6 7
    DetailCurrentStudent, DetailCurrentStudentSettings, ListMajors,\
    DetailMajor, WelcomeName, WelcomePrivacy, WelcomeMajor, WelcomeSocial
8

Jason D Yeomans's avatar
Jason D Yeomans committed
9 10

urlpatterns = patterns('',
Jason D Yeomans's avatar
Jason D Yeomans committed
11

Jason D Yeomans's avatar
Jason D Yeomans committed
12
    url(r'', include('allauth.urls')),
13

14 15 16
    url(r'^majors/$',
        cache_page(60 * 15)(ListMajors.as_view()),
        name='list_majors'),
Daniel W Bond's avatar
Daniel W Bond committed
17

18 19
    url(r'^majors/(?P<slug>[\w-]+)/(?P<major>[\w-]+)/$',
        cache_page(60 * 2)(DetailMajor.as_view()),
20 21
        name='detail_major'),

22
    url(r'^student/$',
23 24 25
        cache_page(60 * 2)(DetailCurrentStudent.as_view()),
        name='detailCurrentStudent'),

26
    url(r'^student/(?P<slug>[\w-]+)/$',
27 28
        cache_page(60 * 2)(DetailStudent.as_view()),
        name='detail_student'),
Daniel W Bond's avatar
Daniel W Bond committed
29

Daniel W Bond's avatar
Daniel W Bond committed
30 31
    url(r'^student/(?P<slug>[\w-]+)/settings/$',
        cache_page(4)(UpdateStudent.as_view()),
32
        name='updateStudent'),
33 34

    url(r'^settings/$',
35 36
        cache_page(4)(DetailCurrentStudentSettings.as_view()),
        name='currentStudentSettings'),
37 38 39

    # first welcome page
    # let's verify your name and optionally select a gender
40
    url(r'^welcome/(?P<slug>[\w-]+)/1/$',
41 42 43 44
        WelcomeName.as_view(), name='welcomeName'),

    # second welcome page
    # let's set your room and privacy
45
    url(r'^welcome/(?P<slug>[\w-]+)/2/$',
46 47 48 49
        WelcomePrivacy.as_view(), name='welcomePrivacy'),

    # third welcome page
    # let's verify your major
50
    url(r'^welcome/(?P<slug>[\w-]+)/3/$',
51 52 53 54
        WelcomeMajor.as_view(), name='welcomeMajor'),

    # fourth welcome page
    # set your social media links
55
    url(r'^welcome/(?P<slug>[\w-]+)/4/$',
56 57
        WelcomeSocial.as_view(), name='welcomeSocial'),

Jason D Yeomans's avatar
Jason D Yeomans committed
58
)