Ejemplo n.º 1
0
import os

# local_settings should define a 'options' dictionary with
# configuration values.
try:
    from local_settings import options
except ImportError:
    options = {}

DEBUG = True
TEMPLATE_DEBUG = DEBUG

APPROOT = os.path.dirname(os.path.dirname(__file__)) + os.sep

ADMINS = (
 (options.get('admin_name', 'Olivier Aubert'), options.get('admin_mail', '*****@*****.**')),
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': options.get('db_engine', 'django.db.backends.sqlite3'), # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': options.get('db_name', APPROOT + 'db.sqlite3'),  # Or path to database file if using sqlite3.
        'USER': options.get('db_user', ''),                      # Not used with sqlite3.
        'PASSWORD': options.get('db_password', ''),                  # Not used with sqlite3.
        'HOST': options.get('db_host', ''),                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': options.get('db_port', ''),                      # Set to empty string for default. Not used with sqlite3.
    }
}
Ejemplo n.º 2
0
APPROOT = os.path.dirname(os.path.dirname(__file__)) + os.sep

import logging, copy
from django.contrib import messages
from django.utils.log import DEFAULT_LOGGING
from django.utils.translation import ugettext_lazy as _

# local_settings should define a 'options' dictionary with
# configuration values.
try:
    from local_settings import options
except ImportError:
    options = {}

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = options.get('secret_key', 'no_secret_at_all_key')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = options.get('development', False)

ALLOWED_HOSTS = options.get('allowed_hosts', [])

EMAIL_HOST = 'localhost'
DEFAULT_FROM_EMAIL = options.get('admin_email', '*****@*****.**')
SERVER_EMAIL = options.get('admin_email', '*****@*****.**')
EMAIL_SUBJECT_PREFIX = '[COCoNotes] '
ADMINS = [ ('Webmaster', options.get('admin_email', '*****@*****.**')) ]

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = os.path.join(APPROOT, "media/")