Commit 7103d7d2 authored by Daniel W Bond's avatar Daniel W Bond

the 1.10 upgrade involves (1) changing urls to a nice list, and...

parent b00ac5ab
# standard library imports
from __future__ import absolute_import, print_function
# core django imports
from django.conf.urls import patterns, include, url
from django.conf.urls import url, include
# imports from your apps
from .views import (DetailStudent, UpdateStudent, DeleteStudent,
ListMajors, DetailMajor,
......@@ -9,7 +9,7 @@ from .views import (DetailStudent, UpdateStudent, DeleteStudent,
from .adapter import RemoveSocialConfirmationView
urlpatterns = patterns('',
urlpatterns = [
# social media confirmation
url(r'', include('allauth.urls')),
......@@ -44,4 +44,4 @@ urlpatterns = patterns('',
# delete confirmation
url(r'^student/(?P<confirmer_slug>[\w-]+)/flag/(?P<student_slug>[\w-]+)/remove/$',
DeleteConfirmation.as_view(), name='deleteConfirmation'),
)
]
# standard library imports
from __future__ import absolute_import, print_function
# core django imports
from django.conf.urls import patterns, include, url
from django.conf.urls import url, include
from django.views.generic import RedirectView
from django.views.decorators.cache import cache_page
# imports from your apps
......@@ -12,7 +12,7 @@ from .views import BuildingList, BuildingRetrieve, FloorRetrieve, RoomRetrieve,\
# API v1
# separate out major and building patterns
building_urls = patterns('',
building_urls = [
url(r'^$', cache_page(60*60)(BuildingList.as_view()),name='api_list_buildings'),
url(r'^(?P<building_name>[\w-]+)/$', cache_page(60*60)(BuildingRetrieve.as_view()),
name='api_detail_building'),
......@@ -23,22 +23,22 @@ building_urls = patterns('',
url(r'^(?P<floor__building__building_name>[\w-]+)/(?P<floor__floor_num>\d+)/(?P<room_num>\d+)/$', cache_page(60*60)(RoomRetrieve.as_view()),
name='api_detail_room'),
# list all the rooms still?
)
]
major_urls = patterns('',
major_urls = [
url(r'^$', cache_page(60*60)(MajorList.as_view()),
name='api_list_majors'),
url(r'^(?P<slug>[\w-]+)/$', cache_page(60*60)(MajorRetrieve.as_view()),
name='api_detail_major'),
)
]
# Added API Caching
urlpatterns = patterns('',
urlpatterns = [
url(r'^v1/housing/', include(building_urls)),
url(r'^v1/majors/', include(major_urls)),
url(r'^v1/$', cache_page(60*60)(APIRoot.as_view()),
name='api_root'),
url(r'^$', RedirectView.as_view(pattern_name='api_root')),
)
]
# Subsequent API versions below
# standard library imports
from __future__ import absolute_import, print_function
# core django imports
from django.conf.urls import patterns, url
from django.conf.urls import url
# imports from your apps
from .views import ListBuildings, DetailBuilding, DetailFloor, DetailRoom
urlpatterns = patterns('',
urlpatterns = [
url(r'^$', ListBuildings.as_view(), name='list_buildings'),
......@@ -19,4 +19,4 @@ urlpatterns = patterns('',
url(r'^(?P<building>[\w-]+)/(?P<floor>[\w-]+)/(?P<room>[\w-]+)/$',
DetailRoom.as_view(), name='detail_room'),
)
]
# standard library imports
from __future__ import absolute_import, print_function
# core django imports
from django.conf.urls import patterns, include, url
from django.conf.urls import url, include
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from django.contrib import admin
# third party imports
from haystack.views import SearchView
from django.views.generic import RedirectView
from cas.views import logout as cas_logout
# imports from your apps
from core.utils import custom_cas_login
from accounts.forms import AccountSearchForm
from .views import HomePageView, RedirectSettings, RedirectSlug
......@@ -18,7 +20,7 @@ admin.site.login = login_required(admin.site.login)
handle404 = TemplateView.as_view(template_name="404.html")
handle500 = TemplateView.as_view(template_name="500.html")
urlpatterns = patterns('',
urlpatterns = [
# project-level urls
url(r'^$', HomePageView.as_view(), name='homepage'),
......@@ -35,8 +37,8 @@ urlpatterns = patterns('',
login_url='login'), name='search'),
# login and logout
url(r'^login/', 'core.utils.custom_cas_login', name='login'),
url(r'^logout/', 'cas.views.logout', name='logout'),
url(r'^login/', custom_cas_login, name='login'),
url(r'^logout/', cas_logout, name='logout'),
# url(r'^login/$', 'django.contrib.auth.views.login', name='login'),
# url(r'^logout/$', 'django.contrib.auth.views.logout', name='logout'),
......@@ -50,4 +52,5 @@ urlpatterns = patterns('',
url(r'^settings/', RedirectSettings.as_view()),
# note that this is the very last, 'cause it tries to match basically anything else
url(r'^(?P<slug>[\w-]+)/', RedirectSlug.as_view()),
)
]
# standard library imports
from __future__ import absolute_import, print_function
# core django imports
from django.conf.urls import patterns, url
from django.conf.urls import url
from django.views.generic import RedirectView
from django.core.urlresolvers import reverse_lazy
# imports from your apps
from .views import WelcomeName, WelcomePrivacy, WelcomeMajor, WelcomeSocial
urlpatterns = patterns('',
urlpatterns = [
# first welcome page
# let's verify your name and optionally select a gender
......@@ -34,4 +34,4 @@ urlpatterns = patterns('',
url(r'^4/$',
WelcomeSocial.as_view(), name='welcomeSocial'),
)
]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment