diff --git a/example/example/settings.py b/example/example/settings.py index f3299f5..6fa577b 100644 --- a/example/example/settings.py +++ b/example/example/settings.py @@ -2,17 +2,11 @@ import json import os -PROJECT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) +BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) DEBUG = True TEMPLATE_DEBUG = DEBUG -ADMINS = ( - # ('Your Name', 'your_email@example.com'), -) - -MANAGERS = ADMINS - DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. @@ -37,8 +31,6 @@ # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'en-us' -SITE_ID = 1 - # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = True @@ -74,7 +66,7 @@ # Put strings here, like "/home/html/static" or "C:/www/django/static". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. - os.path.join(PROJECT_PATH, 'static'), + os.path.join(BASE_DIR, 'static'), ) # List of finder classes that know how to find static files in @@ -88,12 +80,6 @@ # Make this unique, and don't share it with anybody. SECRET_KEY = '&k9%jt6ozi$7o+xalyhx9=^e6+*mtb*s9)crr9mhp=ti8utykl' -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', -# 'django.template.loaders.eggs.Loader', -) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', @@ -101,8 +87,7 @@ 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', - # Uncomment the next line for simple clickjacking protection: - # 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) ROOT_URLCONF = 'example.urls' @@ -114,20 +99,16 @@ # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. - os.path.join(PROJECT_PATH, 'templates'), + os.path.join(BASE_DIR, 'templates'), ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', - 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', - # Uncomment the next line to enable the admin: 'django.contrib.admin', - # Uncomment the next line to enable admin documentation: - # 'django.contrib.admindocs', 'allaccess', ) @@ -186,33 +167,3 @@ 'django.core.context_processors.static', 'allaccess.context_processors.available_providers', ) - - -ENV_FILE = '/home/dotcloud/environment.json' - -if os.path.exists(ENV_FILE): - # We are on Dotcloud - with open('/home/dotcloud/environment.json') as f: - env = json.load(f) - - DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'allaccess-demo', - 'USER': env['DOTCLOUD_DB_SQL_LOGIN'], - 'PASSWORD': env['DOTCLOUD_DB_SQL_PASSWORD'], - 'HOST': env['DOTCLOUD_DB_SQL_HOST'], - 'PORT': int(env['DOTCLOUD_DB_SQL_PORT']), - } - } - - MEDIA_ROOT = '/home/dotcloud/data/media/' - - STATIC_ROOT = '/home/dotcloud/volatile/static/' - - DEBUG = False - TEMPLATE_DEBUG = DEBUG - - SECRET_KEY = env['SECRET_KEY'] - - ALLOWED_HOSTS = ['allaccess-mlavin.dotcloud.com', ]