Browse Source

Setup caching.

master
Nick Sergeant 6 years ago
parent
commit
df37183d44
2 changed files with 14 additions and 3 deletions
  1. +4
    -3
      requirements.txt
  2. +10
    -0
      settings.py

+ 4
- 3
requirements.txt View File

@@ -1,7 +1,9 @@
Django==1.8.3
Fabric==1.10.2
Pygments==2.0.2
defusedxml==0.4.1
dj-database-url==0.3.0
dj-static==0.0.6
Django==1.8.3
django-annoying==0.8.3
django-bcrypt==0.9.2
django-debug-toolbar==1.3.2
@@ -16,7 +18,6 @@ django-tastypie==0.12.2
django-templatetag-sugar==1.0
ecdsa==0.13
elasticsearch==1.6.0
Fabric==1.10.2
gunicorn==19.3.0
lxml==3.4.4
markdown2==2.3.0
@@ -26,7 +27,7 @@ parsedatetime==1.5
psycopg2==2.6.1
py-bcrypt==0.4
pycrypto==2.6.1
Pygments==2.0.2
pylibmc==1.5.0
python-dateutil==2.4.2
python-mimeparse==0.1.4
python-postmark==0.4.7


+ 10
- 0
settings.py View File

@@ -25,6 +25,13 @@ if 'DATABASE_URL' in os.environ:
"http_auth": es.username + ':' + es.password
}

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
'LOCATION': '127.0.0.1:11211',
}
}

ABSOLUTE_URL_OVERRIDES = {'auth.user': lambda u: "/%s/" % u.username}
ACCOUNT_ACTIVATION_DAYS = 0
ADMINS = (('Nick Sergeant', 'nick@snipt.net'),)
@@ -124,6 +131,9 @@ LOGGING = {
'loggers': {}
}
MIDDLEWARE_CLASSES = (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.common.CommonMiddleware',


Loading…
Cancel
Save