Commit 3637e5f0 authored by Grady Moran's avatar Grady Moran

added cacheing package

configured settings files
added decorations in urls.py

todo:
adjust cacheing levels to something that makes sense
not totally sure which pages should be cached in the first place (obviously static pages, but should there be any level of cacheing on more frequently accessed pages like my_links?)
not sure how to test outside docker or whether settings.py.template is correct (roomlist copypaste)

this is not a final commit
parent cd3fbef5
Pipeline #926 passed with stage
in 1 minute and 3 seconds
......@@ -168,3 +168,10 @@ EMAIL_TO = "to@example.com"
# Domain used to email to users. See line 231 in views.py
# ie. in Mason's case '@masonlive.gmu.edu'
EMAIL_DOMAIN = os.environ['email_domain']
# dummy cache for development-- doesn't actually cache things
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
......@@ -179,3 +179,14 @@ EMAIL_TO = "to@example.com"
# Domain used to email to users. See line 231 in views.py
# ie. in Mason's case '@masonlive.gmu.edu'
EMAIL_DOMAIN = "@example.com"
# Use redis cache when not in local development
if DEBUG:
pass
else:
CACHES = {
'default': {
'BACKEND': 'redis_cache.RedisCache',
'LOCATION': '/var/run/redis/redis.sock',
},
}
......@@ -6,6 +6,7 @@ from django.conf.urls import include, url
import django.contrib.auth.views
from django.contrib import admin
from django.conf import settings
from django.views.decorators.cache import cache_page
from django.views.generic import TemplateView
# App Imports
......@@ -18,26 +19,26 @@ admin.autodiscover()
# Main list of project URL's
urlpatterns = [
# / - Homepage url.
url(r'^$', go.views.index, name='index'),
url(r'^$', cache_page(4)(go.views.index), name='index'),
# /view/<short> - View URL data.
url(r'^view/(?P<short>[-\w]+)$', go.views.view, name='view'),
url(r'^view/(?P<short>[-\w]+)$', cache_page(60*15)(go.views.view), name='view'),
# /about - About page.
url(r'^about/?$', TemplateView.as_view(template_name='core/about.html'),
url(r'^about/?$', cache_page(60*15)(TemplateView.as_view(template_name='core/about.html')),
name='about'),
# /signup - Signup page for access.
url(r'^signup/?$', go.views.signup, name='signup'),
# /myLinks - My-Links page, view and review links.
url(r'^myLinks/?$', go.views.my_links, name='my_links'),
url(r'^myLinks/?$', cache_page(10)(go.views.my_links), name='my_links'),
# /delete/<short> - Delete a link, no content display.
url(r'^delete/(?P<short>[-\w]+)$', go.views.delete, name='delete'),
# /registered - registration complete page
url(r'^registered/?$', TemplateView.as_view(template_name='registered.html'),
url(r'^registered/?$', cache_page(60*15)(TemplateView.as_view(template_name='registered.html')),
name='registered'),
# /admin - Administrator interface.
......
Django==1.10
django-crispy-forms==1.6.0
django-ratelimit==1.0.1
django-redis-cache==1.6.4
git+https://github.com/bruno207/django-qrcode.git
git+https://github.com/kstateome/django-cas.git
git+https://github.com/bruno207/django-bootstrap3-datetimepicker.git
hashids==1.1.0
mysqlclient
redis==2.10.5
requests==2.11.0
simplejson==3.8.2
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