From 4eccd1f511435ff8db0fe1db3ba34293bf5fbbb7 Mon Sep 17 00:00:00 2001 From: Lorin Hochstein Date: Thu, 5 Feb 2015 22:14:11 -0500 Subject: [PATCH] add templates --- ch06/playbooks/templates/local_settings.py.j2 | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 ch06/playbooks/templates/local_settings.py.j2 diff --git a/ch06/playbooks/templates/local_settings.py.j2 b/ch06/playbooks/templates/local_settings.py.j2 new file mode 100644 index 0000000..db78330 --- /dev/null +++ b/ch06/playbooks/templates/local_settings.py.j2 @@ -0,0 +1,37 @@ +from __future__ import unicode_literals + +SECRET_KEY = "{{ secret_key }}" +NEVERCACHE_KEY = "{{ nevercache_key }}" +ALLOWED_HOSTS = [{% for domain in domains %}"{{ domain }}",{% endfor %}] + +DATABASES = { + "default": { + # Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle". + "ENGINE": "django.db.backends.postgresql_psycopg2", + # DB name or path to database file if using sqlite3. + "NAME": "{{ proj_name }}", + # Not used with sqlite3. + "USER": "{{ proj_name }}", + # Not used with sqlite3. + "PASSWORD": "{{ db_pass }}", + # Set to empty string for localhost. Not used with sqlite3. + "HOST": "127.0.0.1", + # Set to empty string for default. Not used with sqlite3. + "PORT": "", + } +} + +SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTOCOL", "https") + +CACHE_MIDDLEWARE_SECONDS = 60 + +CACHE_MIDDLEWARE_KEY_PREFIX = "{{ proj_name }}" + +CACHES = { + "default": { + "BACKEND": "django.core.cache.backends.memcached.MemcachedCache", + "LOCATION": "127.0.0.1:11211", + } +} + +SESSION_ENGINE = "django.contrib.sessions.backends.cache" -- 2.44.0