urls.py 670 Bytes
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
3
from accounts.models import Student
Jason D Yeomans's avatar
Jason D Yeomans committed
4 5 6 7 8 9 10 11

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # 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'),
12 13 14 15 16 17 18

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