urls.py 1.38 KB
Newer Older
Jason D Yeomans's avatar
Jason D Yeomans committed
1
from django.conf.urls import patterns, include, url
2
from accounts.views import DetailStudent, CreateStudent, DetailStudentSettings, DetailCurrentStudent, DetailCurrentStudentSettings
3
from accounts.models import Student
Jason D Yeomans's avatar
Jason D Yeomans committed
4
5
6
7
8

from django.contrib import admin
admin.autodiscover()

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

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

Jason D Yeomans's avatar
Jason D Yeomans committed
12
13
14
    # login and logout
    url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, name='login'),
    url(r'^logout/$', 'django.contrib.auth.views.logout', {'template_name': 'index.html'}, name='logout'),
15
16
17
18
19
20
21

    url(r'^student/(?P<slug>[\w-]+)/$',
        DetailStudent.as_view(
            model=Student,
            context_object_name='student',
            template_name='detailStudent.html'),
        name='detailStudent'),
Daniel W Bond's avatar
Daniel W Bond committed
22

23
24
25
26
27
28
29
    url(r'^student/$',
        DetailCurrentStudent.as_view(
            model=Student,
            context_object_name='student',
            template_name='detailStudent.html'),
        name='detailCurrentStudent'),

Daniel W Bond's avatar
Daniel W Bond committed
30
31
32
33
34
    url(r'^create/$',
        CreateStudent.as_view(
            model=Student,
            template_name="createStudent.html"),
        name='createStudent'),
35
36
37
38
39
40
41

    url(r'^settings/$',
        DetailCurrentStudentSettings.as_view(
            model=Student,
            context_object_name='student',
            template_name="studentSettings.html"),
        name='currentStudentSettings'),
Jason D Yeomans's avatar
Jason D Yeomans committed
42
)