diff --git a/ram/ram/local_settings.py.tmpl b/ram/ram/local_settings.py.tmpl index d77b50b..359bbbd 100644 --- a/ram/ram/local_settings.py.tmpl +++ b/ram/ram/local_settings.py.tmpl @@ -1,7 +1,8 @@ # vim: syntax=python +from django.conf import settings """ -Django local_settings for ram project. +Example of changes suitable for production """ # SECURITY WARNING: keep the secret key used in production secret! @@ -12,9 +13,23 @@ SECRET_KEY = ( # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False +# SECURITY WARNING: cache middlewares must be loaded before cookies one +MIDDLEWARE = [ + "django.middleware.cache.UpdateCacheMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.cache.FetchFromCacheMiddleware", +] + settings.MIDDLEWARE + +CACHES = { + "default": { + "BACKEND": "django.core.cache.backends.redis.RedisCache", + "LOCATION": "redis://127.0.0.1:6379", + } +} + +CACHE_MIDDLEWARE_SECONDS = 300 STORAGE_DIR = BASE_DIR / "storage" -ALLOWED_HOSTS = ["127.0.0.1"] +ALLOWED_HOSTS = ["127.0.0.1", "myhost"] CSRF_TRUSTED_ORIGINS = ["https://myhost"] -ROOT_URLCONF = "ram.urls" STATIC_URL = "static/" MEDIA_URL = "media/" diff --git a/requirements-prod.txt b/requirements-prod.txt index 8f22dcc..b3d9d01 100644 --- a/requirements-prod.txt +++ b/requirements-prod.txt @@ -1 +1,2 @@ gunicorn +pylibmc