urls.py 1.38 KB
Newer Older
1
2
# standard library imports
from __future__ import absolute_import, print_function
3
# core django imports
Jason D Yeomans's avatar
Jason D Yeomans committed
4
from django.conf.urls import patterns, include, url
5
# imports from your apps
Daniel W Bond's avatar
pep8 me    
Daniel W Bond committed
6
from .views import (DetailStudent, UpdateStudent, ListMajors,
7
                    DetailMajor, CreateConfirmation, DeleteConfirmation)
8
from .adapter import RemoveSocialConfirmationView
9

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

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

13
    # social media confirmation
Jason D Yeomans's avatar
Jason D Yeomans committed
14
    url(r'', include('allauth.urls')),
15

16
    # majors pages
17
    url(r'^majors/$', ListMajors.as_view(), name='list_majors'),
Daniel W Bond's avatar
Daniel W Bond committed
18

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

22
    # student profile pages
23
    url(r'^student/(?P<slug>[\w-]+)/$',
24
        DetailStudent.as_view(), name='detail_student'),
Daniel W Bond's avatar
Daniel W Bond committed
25

26
    # student settings
Daniel W Bond's avatar
Daniel W Bond committed
27
    url(r'^student/(?P<slug>[\w-]+)/settings/$',
28
        UpdateStudent.as_view(), name='update_student'),
29

30
    # custom allauth page to disconnect a social media account
31
32
33
34
    url(r'^student/(?P<slug>[\w-]+)/settings/social/remove/$',
        RemoveSocialConfirmationView.as_view(),
        name='remove_social'),

35
36
37
38
39
40
41
    # student confirmation pages
    url(r'^student/(?P<student_slug>[\w-]+)/flag/$',
        CreateConfirmation.as_view(), name='createConfirmation'),

    # delete
    url(r'^student/(?P<student_slug>[\w-]+)/flag/(?P<slug>[\w-]+)/$',
        DeleteConfirmation.as_view(), name='deleteConfirmation'),
Jason D Yeomans's avatar
Jason D Yeomans committed
42
)