Commit a3fcedff authored by Daniel W Bond's avatar Daniel W Bond

new django 1.10-style urls

parent 01c1e71d
# core django imports
from django.conf.urls import patterns, url
from django.conf.urls import url
from django.views.decorators.cache import cache_page
# imports from your apps
from .views import DetailStudent, StudentRatings, UpdateStudent
urlpatterns = patterns('',
urlpatterns = [
url(r'^name-change/$',
UpdateStudent.as_view(), name='name_change'),
......@@ -13,4 +13,4 @@ urlpatterns = patterns('',
url(r'^(?P<slug>[\w-]+)/ratings/$',
cache_page(6)(StudentRatings.as_view()), name='ratings'),
)
]
# core django imports
from django.conf.urls import patterns, url
from django.conf.urls import url
from django.views.decorators.cache import cache_page
# imports from your apps
from .views import DetailLookout, CreateLookout, DeleteLookout
urlpatterns = patterns('',
urlpatterns = [
url(r'^new/$',
CreateLookout.as_view(), name='create_lookout'),
......@@ -14,4 +14,4 @@ urlpatterns = patterns('',
url(r'^(?P<slug>[\w-]+)/delete/$',
DeleteLookout.as_view(), name='delete_lookout'),
)
]
# core django imports
from django.conf.urls import patterns, url
from django.conf.urls import url
from django.views.decorators.cache import cache_page
# imports from your apps
from .views import ModLandingView, FlagModView, ListingNumModView,\
UserEmailRatioModView
urlpatterns = patterns('',
urlpatterns = [
url(r'^$', cache_page(60 * 15)(ModLandingView.as_view()), name='mod_page'),
url(r'^flags/$', FlagModView.as_view(), name='flag_mod'),
......@@ -14,4 +14,4 @@ urlpatterns = patterns('',
url(r'^email-ratio/$', UserEmailRatioModView.as_view(), name='email_ratio'),
)
]
# core django imports
from django.conf.urls import patterns, include, url
from django.conf.urls import include, url
from django.views.generic import TemplateView
from django.conf.urls.static import static
from django.conf import settings
......@@ -8,6 +8,7 @@ from django.views.decorators.cache import cache_page
from django.contrib.auth.decorators import login_required
# third party imports
from haystack.views import SearchView
from cas.views import login, logout
# imports from your apps
from .views import HomepageView, ChartsView
from trades.forms import ListingSearchForm
......@@ -19,7 +20,7 @@ handle403 = TemplateView.as_view(template_name="403.html")
handle404 = TemplateView.as_view(template_name="404.html")
handle500 = TemplateView.as_view(template_name="500.html")
urlpatterns = patterns('',
urlpatterns = [
# app-level urls
url(r'^share/', include('trades.urls')),
url(r'^student/', include('core.urls')),
......@@ -45,12 +46,12 @@ urlpatterns = patterns('',
name='privacy'),
# user authentication
url(r'^login/$', 'cas.views.login', name='login'),
url(r'^logout/$', 'cas.views.logout', name='logout'),
url(r'^login/$', login, name='login'),
url(r'^logout/$', logout, name='logout'),
# admin pages
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', include(admin.site.urls)),
# location of user-uploaded media files from settings.py (for local)
) #+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
] #+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# core django imports
from django.conf.urls import patterns, url
from django.conf.urls import url
from django.views.decorators.cache import cache_page
# imports from your apps
from .views import ListListings, CreateListing, ListingPage,\
......@@ -9,7 +9,7 @@ from .views import ListListings, CreateListing, ListingPage,\
EditBid, DeleteListing
urlpatterns = patterns('',
urlpatterns = [
url(r'^all/$',
cache_page(60 * 2)(ListListings.as_view()), name='list_listings'),
......@@ -61,4 +61,4 @@ urlpatterns = patterns('',
url(r'^listing/(?P<listing_slug>[\w-]+)/rating/(?P<slug>[\w-]+)/remove/$',
DeleteRating.as_view(), name='delete_rating'),
)
]
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