settings inherits from settings_local. No need for a settings_local in VCS,

it's just confusing
This commit is contained in:
Wil Clouser 2010-10-12 21:15:27 -07:00
Родитель e267e9c4b8
Коммит 5ada4ee10e
2 изменённых файлов: 49 добавлений и 69 удалений

Просмотреть файл

@ -1,11 +1,19 @@
import os
# Make filepaths relative to settings.
ROOT = os.path.dirname(os.path.abspath(__file__))
path = lambda *a: os.path.join(ROOT, *a)
# Set the project version
PROJECT_VERSION = "1.0a5"
# TODO: This should be handled by prod in a settings_local. By default, we
# shouldn't be in prod mode
# If PRODUCTION do not load development apps
PRODUCTION = True
# Django settings for flightdeck project.
DEBUG = False
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
@ -13,32 +21,47 @@ ADMINS = (
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'NAME': 'zamboni',
'ENGINE': 'django.db.backends.mysql',
'HOST': '',
'PORT': '',
'USER': '',
'PASSWORD': '',
'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
'TEST_CHARSET': 'utf8',
'TEST_COLLATION': 'utf8_general_ci',
},
}
# How many packages per type should be displayed on the homepage
HOMEPAGE_ITEMS_LIMIT = 5
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
TIME_ZONE = 'America/Chicago'
TIME_ZONE = 'America/Los_Angeles'
# Language code for this installation. All choices can be found here:
# 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
MEDIA_ROOT = path('media')
FRAMEWORK_PATH = os.path.dirname(os.path.dirname(__file__)) + '/'
SDK_SOURCE_DIR = path('lib') # TODO: remove this var
MEDIA_PREFIX = os.path.join(FRAMEWORK_PATH, 'flightdeck/')
VIRTUAL_ENV = os.environ.get('VIRTUAL_ENV')
# Media section
MEDIA_ROOT = '' # this will get overwritten in settings_local.py
MEDIA_PREFIX = '' # this will get overwritten in settings_local.py
MEDIA_SUFFIX = 'media'
# Connections from which IP should be considered internal
INTERNAL_IPS = ('127.0.0.1',)
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
@ -100,6 +123,7 @@ TEMPLATE_DIRS = ()
# Change default test runner (works only with mysql)
TEST_RUNNER = 'test_utils.runner.RadicalTestSuiteRunner'
# Modify in settings_local if needed
SELENIUM_CONFIG = {}
@ -140,10 +164,6 @@ DEV_MIDDLEWARE_CLASSES = (
'debug_toolbar.middleware.DebugToolbarMiddleware',
)
# overwrite above settings with the ones from settings_local.py
from settings_local import *
if PRODUCTION:
for app in DEV_APPS:
if app in INSTALLED_APPS:
@ -152,3 +172,20 @@ if PRODUCTION:
for middleware in MIDDLEWARE_CLASSES:
if middleware in DEV_MIDDLEWARE_CLASSES:
MIDDLEWARE_CLASSES.remove(middleware)
#AUTH_DATABASE = {
# 'NAME': 'db_name',
# 'TABLE': 'users_table_name',
# 'USER': 'db_user',
# 'PASSWORD': '', # db_password
# 'HOST': '',
# 'PORT': ''
#}
# If you want to run Selenium tests, you'll need to have a server running.
# Then give this a dictionary of settings. Something like:
#SELENIUM_CONFIG = {
# 'HOST': 'localhost',
# 'PORT': 4444,
# 'BROWSER': '*firefox',
#}

Просмотреть файл

@ -1,57 +0,0 @@
"""
Local settings
Please copy to settings_local.py which should remain private
"""
import os
FRAMEWORK_PATH = os.path.dirname(os.path.dirname(__file__)) + '/'
ADMINS = (
#('Your Name', 'your@email.info'),
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'db_name',
'USER': 'db_user',
'PASSWORD': '', # database password
'HOST': '',
'PORT': '',
}
}
SDK_SOURCE_DIR = os.path.join(FRAMEWORK_PATH, 'sdk_versions/')
MEDIA_ROOT = os.path.join(FRAMEWORK_PATH, 'flightdeck/media')
MEDIA_PREFIX = os.path.join(FRAMEWORK_PATH, 'flightdeck/')
SECRET_KEY = 'somerandomstring' # please change it
# this setting is needed so os applicatio') run from within the site
# will use the same virtual environment
VIRTUAL_ENV = os.environ.get('VIRTUAL_ENV')
ACTIVATE_THIS = os.path.join(VIRTUAL_ENV, 'bin/activate_this.py')
#AUTH_DATABASE = {
# 'NAME': 'db_name',
# 'TABLE': 'users_table_name',
# 'USER': 'db_user',
# 'PASSWORD': '', # db_password
# 'HOST': '',
# 'PORT': ''
#}
# If you want to run Selenium tests, you'll need to have a server running.
# Then give this a dictionary of settings. Something like:
#SELENIUM_CONFIG = {
# 'HOST': 'localhost',
# 'PORT': 4444,
# 'BROWSER': '*firefox',
#}
PRODUCTION = True
DEBUG = False
TEMPLATE_DEBUG = DEBUG