Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import sys
- DEBUG = True
- TEMPLATE_DEBUG = DEBUG
- SERVE_MEDIA = True
- USE_CACHE = False
- ADMINS = (
- )
- DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.postgresql_psycopg2',
- 'NAME': 'project',
- 'USER': 'x',
- 'PASSWORD': 'x',
- 'HOST': 'localhost'
- }
- }
- INTERNAL_IPS = ('127.0.0.1',)
- DEBUG_TOOLBAR_CONFIG = {}
- DEBUG_TOOLBAR_CONFIG['INTERCEPT_REDIRECTS'] = False
- SENTRY_TESTING = True
- SENTRY_PUBLIC = True
- EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
- if 'test' in sys.argv:
- DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.sqlite3',
- 'NAME': 'project',
- }
- }
- SOUTH_TESTS_MIGRATE = False
- DEBUG_PROPAGATE_EXCEPTIONS = True
- PROJECT_ROOT = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
- MANAGERS = ADMINS
- TIME_ZONE = 'America/New_York'
- LANGUAGE_CODE = 'en-us'
- SITE_ID = 1
- USE_I18N = False
- USE_L10N = False
- USE_TZ = True
- # Absolute filesystem path to the directory that will hold user-uploaded files.
- # Example: "/home/media/media.lawrence.com/media/"
- MEDIA_ROOT = ''
- MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'includes')
- MEDIA_URL = '/includes/'
- DEFAULT_CACHE_TIMEOUT = 60 * 60 * 10
- SESSION_COOKIE_PATH = '/;HttpOnly'
- TEMPLATE_DIRS = (
- os.path.join(PROJECT_ROOT, 'templates'),
- )
- STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
- STATIC_URL = '/includes/admin/'
- STATICFILES_DIRS = ()
- STATICFILES_FINDERS = (
- 'django.contrib.staticfiles.finders.FileSystemFinder',
- 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
- )
- # Make this unique, and don't share it with anybody.
- SECRET_KEY = 'x'
- # 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',
- )
- TEMPLATE_CONTEXT_PROCESSORS = (
- "django.contrib.auth.context_processors.auth",
- "django.core.context_processors.media",
- "django.core.context_processors.request",
- "django.core.context_processors.csrf",
- "django.core.context_processors.static",
- )
- 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',
- )
- ROOT_URLCONF = 'project.urls'
- # Python dotted path to the WSGI application used by Django's runserver.
- WSGI_APPLICATION = 'project.wsgi.application'
- INSTALLED_APPS = (
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.sites',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- 'grappelli',
- 'django.contrib.admin',
- 'south',
- )
- GRAPPELLI_ADMIN_TITLE = 'Project'
- LOGGING = {
- 'version': 1,
- 'disable_existing_loggers': False,
- 'formatters': {
- 'standard': {
- 'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
- 'datefmt' : "%d/%b/%Y %H:%M:%S"
- },
- },
- 'handlers': {
- 'mail_admins': {
- 'level': 'ERROR',
- 'class': 'django.utils.log.AdminEmailHandler'
- },
- 'logfile': {
- 'level':'DEBUG',
- 'class':'logging.handlers.RotatingFileHandler',
- 'filename': os.path.join(PROJECT_ROOT, "project", "logs", "jobs.log"),
- 'maxBytes': 500000,
- 'backupCount': 2,
- 'formatter': 'standard',
- },
- 'console':{
- 'level':'INFO',
- 'class':'logging.StreamHandler',
- 'formatter': 'standard'
- },
- },
- 'loggers': {
- 'django.request': {
- 'handlers': ['mail_admins'],
- 'level': 'ERROR',
- 'propagate': True,
- },
- 'project': {
- 'handlers': ['console', 'logfile'],
- 'level': 'DEBUG',
- },
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement