urls.py 1.47 KB
Newer Older
Daniel W Bond's avatar
Daniel W Bond committed
1
from django.conf.urls import patterns, include, url
2

3
from .views import HomepageView, ChartsView
Daniel W Bond's avatar
Daniel W Bond committed
4
from django.views.generic import TemplateView
Jean Michel Rouly's avatar
Jean Michel Rouly committed
5

6
7
8
from django.conf.urls.static import static
from django.conf import settings

Jean Michel Rouly's avatar
Jean Michel Rouly committed
9
from django.contrib import admin
Daniel W Bond's avatar
Daniel W Bond committed
10

Jean Michel Rouly's avatar
Jean Michel Rouly committed
11
# Uncomment the next two lines to enable the admin:
Jean Michel Rouly's avatar
Jean Michel Rouly committed
12
admin.autodiscover()
Jean Michel Rouly's avatar
Jean Michel Rouly committed
13

Daniel W Bond's avatar
Daniel W Bond committed
14
15
handle404 = TemplateView.as_view(template_name="404.html")
handle500 = TemplateView.as_view(template_name="500.html")
16

Daniel W Bond's avatar
Daniel W Bond committed
17
urlpatterns = patterns('',
18
19

    # app-level urls
Daniel W Bond's avatar
Daniel W Bond committed
20
    url(r'^share/', include('trades.urls')),
Daniel W Bond's avatar
Daniel W Bond committed
21
    url(r'^student/', include('core.urls')),
Daniel W Bond's avatar
Daniel W Bond committed
22
    url(r'^lookouts/', include('lookouts.urls')),
23

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

27
    # site-wide pages
28
29
    url(r'^$', HomepageView.as_view(), name = 'homepage'),
    url(r'^charts/?$', ChartsView.as_view(), name = 'charts'),
30
31

    ### static pages ###
Daniel W Bond's avatar
Daniel W Bond committed
32
33
34
    url(r'^about/?$', TemplateView.as_view(template_name='about.html'), name='about'),
    url(r'^privacy/?$', TemplateView.as_view(template_name='privacy.html'), name='privacy'),
    url(r'^privacy/opt-out/?$', 'core.views.privacy_opt_out', name='privacy_opt_out'),
35

Daniel W Bond's avatar
Daniel W Bond committed
36
    ### user authentication ###
Daniel W Bond's avatar
Daniel W Bond committed
37
38
39
    url(r'^login/$', 'cas.views.login', name='login'),
    url(r'^logout/$', 'cas.views.logout', name='logout'),

Daniel W Bond's avatar
Daniel W Bond committed
40
    #### admin pages ####
Daniel W Bond's avatar
Daniel W Bond committed
41
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
Jean Michel Rouly's avatar
Jean Michel Rouly committed
42
    url(r'^admin/', include(admin.site.urls)),
43

44
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)