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

7

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

Daniel W Bond's avatar
Daniel W Bond committed
11 12
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
13

14
urlpatterns = patterns('',
15 16

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

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

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

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

    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
34

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