urls.py 1.26 KB
Newer Older
1
from django.conf.urls import patterns, include, url
Jason D Yeomans's avatar
Jason D Yeomans committed
2
from django.contrib.auth.decorators import login_required
Daniel W Bond's avatar
Daniel W Bond committed
3
from django.views.generic import TemplateView
4 5

from django.contrib import admin
Daniel W Bond's avatar
Daniel W Bond committed
6

7
admin.autodiscover()
Jason D Yeomans's avatar
Jason D Yeomans committed
8
admin.site.login = login_required(admin.site.login)
9

Daniel W Bond's avatar
Daniel W Bond committed
10 11
handle404 = TemplateView.as_view(template_name="404.html")
handle500 = TemplateView.as_view(template_name="500.html")
Daniel W Bond's avatar
Daniel W Bond committed
12

13
urlpatterns = patterns('',
14 15

    # project-level urls
Jason D Yeomans's avatar
Jason D Yeomans committed
16
    url(r'^$', TemplateView.as_view( template_name="index.html" ), name='index'),
17
    url(r'^about/$', TemplateView.as_view(template_name='about.html'), name='about'),
Daniel W Bond's avatar
Daniel W Bond committed
18
    url(r'^privacy/$', TemplateView.as_view(template_name='privacy.html'), name='privacy'),
Daniel W Bond's avatar
Daniel W Bond committed
19

20 21
    # app-level urls
    url(r'^housing/', include('housing.urls')),
Jason D Yeomans's avatar
Jason D Yeomans committed
22
    url(r'^accounts/', include('accounts.urls')),
23

Daniel W Bond's avatar
Daniel W Bond committed
24 25 26
    # search
    url(r'^search/', include('haystack.urls'), name='search'),

Daniel W Bond's avatar
Daniel W Bond committed
27
    # login and logout
Jason D Yeomans's avatar
Jason D Yeomans committed
28 29 30 31 32
    #url(r'^login/', 'cas.views.login', name='login'),
    #url(r'^logout/', 'cas.views.logout', name='logout'),

    url(r'^login/$', 'django.contrib.auth.views.login', name='login'),
    url(r'^logout/$', 'django.contrib.auth.views.logout', name='logout'),
Daniel W Bond's avatar
Daniel W Bond committed
33

34
    # alternate interfaces
35 36 37
    url(r'^api/', include('api.urls')),
    url(r'^admin/', include(admin.site.urls)),
)