Commit ceb3073a authored by Daniel W Bond's avatar Daniel W Bond
Browse files

merge conflicts fixed for issuedev branch

parents 10e1587b ce3298a9
......@@ -13,6 +13,7 @@ django-haystack==2.3.1
django-localflavor==1.0
django-model-utils==2.2
django-randomslugfield==0.3.0
django-redis-cache==0.13.0
flake8==2.4.0
mccabe==0.3
MySQL-python==1.2.5
......@@ -20,6 +21,7 @@ oauthlib==0.7.2
pep8==1.5.7
pyflakes==0.8.1
python-openid==2.2.5
redis==2.10.3
requests==2.5.1
requests-oauthlib==0.4.2
six==1.8.0
......
# core django imports
from django.conf.urls import patterns, include, url
from django.views.decorators.cache import cache_page
# imports from your apps
from .views import DetailStudent, UpdateStudent, DetailStudentSettings,\
DetailCurrentStudent, DetailCurrentStudentSettings, UpdateStudentMajor,\
......@@ -10,24 +11,32 @@ urlpatterns = patterns('',
url(r'', include('allauth.urls')),
url(r'^majors/$', ListMajors.as_view(), name='list_majors'),
url(r'^majors/$',
cache_page(60 * 15)(ListMajors.as_view()),
name='list_majors'),
url(r'^majors/(?P<slug>[\w-]+)/(?P<major>[\w-]+)/$', DetailMajor.as_view(),
url(r'^majors/(?P<slug>[\w-]+)/(?P<major>[\w-]+)/$',
cache_page(60 * 2)(DetailMajor.as_view()),
name='detail_major'),
url(r'^student/(?P<slug>[\w-]+)/$',
DetailStudent.as_view(), name='detail_student'),
url(r'^student/$',
DetailCurrentStudent.as_view(), name='detailCurrentStudent'),
cache_page(60 * 2)(DetailCurrentStudent.as_view()),
name='detailCurrentStudent'),
url(r'^student/(?P<slug>[\w-]+)/$',
cache_page(60 * 2)(DetailStudent.as_view()),
name='detail_student'),
url(r'^student/(?P<slug>[\w-]+)/welcome/$',
UpdateStudent.as_view(), name='updateStudent'),
cache_page(60 * 15)(UpdateStudent.as_view()),
name='updateStudent'),
url(r'^(?P<slug>[\w-]+)/major/$',
UpdateStudentMajor.as_view(), name='updateStudentMajor'),
cache_page(4)(UpdateStudentMajor.as_view()),
name='updateStudentMajor'),
url(r'^settings/$',
DetailCurrentStudentSettings.as_view(), name='currentStudentSettings'),
cache_page(4)(DetailCurrentStudentSettings.as_view()),
name='currentStudentSettings'),
)
# core django imports
from django.conf.urls import patterns, url
from django.views.decorators.cache import cache_page
# imports from your apps
from .views import ListBuildings, DetailBuilding, DetailFloor, DetailRoom
......@@ -10,12 +11,15 @@ urlpatterns = patterns('',
ListBuildings.as_view(), name='list_buildings'),
url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/$',
DetailBuilding.as_view(), name='detail_building'),
cache_page(60 * 15)(DetailBuilding.as_view()),
name='detail_building'),
url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/(?P<floor>[\w-]+)/$',
DetailFloor.as_view(), name='detail_floor'),
cache_page(60 * 2)(DetailFloor.as_view()),
name='detail_floor'),
url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/(?P<floor>[\w-]+)/(?P<room>[\w-]+)/$',
DetailRoom.as_view(), name='detail_room'),
cache_page(60 * 2)(DetailRoom.as_view()),
name='detail_room'),
)
......@@ -167,3 +167,14 @@ HAYSTACK_CONNECTIONS = {
# The RealtimeSignalProcessor allows for objects to indexed as soon as
# they are created -- in real time.
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
# Use redis cache when not in local development
if DEBUG:
pass
else:
CACHES = {
'default': {
'BACKEND': 'redis_cache.RedisCache',
'LOCATION': '/var/run/redis/redis.sock',
},
}
......@@ -3,7 +3,7 @@ from django.conf.urls import patterns, include, url
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from django.contrib import admin
from django.views.decorators.cache import cache_page
admin.autodiscover()
admin.site.login = login_required(admin.site.login)
......@@ -14,9 +14,15 @@ handle500 = TemplateView.as_view(template_name="500.html")
urlpatterns = patterns('',
# project-level urls
url(r'^$', TemplateView.as_view(template_name="index.html"), name='index'),
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'^$',
cache_page(4)(TemplateView.as_view(template_name="index.html")),
name='index'),
url(r'^about/$',
cache_page(60 * 15)(TemplateView.as_view(template_name='about.html')),
name='about'),
url(r'^privacy/$',
cache_page(60 * 15)(TemplateView.as_view(template_name='privacy.html')),
name='privacy'),
# app-level urls
url(r'^housing/', include('housing.urls')),
......
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