Skip to content

Commit

Permalink
Update example project settings to remove warnings on 1.7. Remove ref…
Browse files Browse the repository at this point in the history
…erences to dotcloud.
  • Loading branch information
mlavin committed Jun 27, 2014
1 parent 06bd555 commit 8c96c2a
Showing 1 changed file with 4 additions and 53 deletions.
57 changes: 4 additions & 53 deletions example/example/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', '[email protected]'),
)

MANAGERS = ADMINS

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -88,21 +80,14 @@
# 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',
'django.contrib.sessions.middleware.SessionMiddleware',
'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'
Expand All @@ -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',
)

Expand Down Expand Up @@ -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', ]

0 comments on commit 8c96c2a

Please sign in to comment.