src/p4l/settings.py
changeset 0 81e7900b06a7
child 1 d184767fdd52
equal deleted inserted replaced
-1:000000000000 0:81e7900b06a7
       
     1 # Django settings for p4l project.
       
     2 
       
     3 DEBUG = True
       
     4 TEMPLATE_DEBUG = DEBUG
       
     5 
       
     6 ADMINS = (
       
     7     # ('Your Name', 'your_email@example.com'),
       
     8 )
       
     9 
       
    10 MANAGERS = ADMINS
       
    11 
       
    12 DATABASES = {
       
    13     'default': {
       
    14         'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
       
    15         'NAME': '',                      # Or path to database file if using sqlite3.
       
    16         # The following settings are not used with sqlite3:
       
    17         'USER': '',
       
    18         'PASSWORD': '',
       
    19         'HOST': '',                      # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
       
    20         'PORT': '',                      # Set to empty string for default.
       
    21     }
       
    22 }
       
    23 
       
    24 # Hosts/domain names that are valid for this site; required if DEBUG is False
       
    25 # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
       
    26 ALLOWED_HOSTS = []
       
    27 
       
    28 # Local time zone for this installation. Choices can be found here:
       
    29 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
       
    30 # although not all choices may be available on all operating systems.
       
    31 # In a Windows environment this must be set to your system time zone.
       
    32 TIME_ZONE = 'America/Chicago'
       
    33 
       
    34 # Language code for this installation. All choices can be found here:
       
    35 # http://www.i18nguy.com/unicode/language-identifiers.html
       
    36 LANGUAGE_CODE = 'en-us'
       
    37 
       
    38 ugettext = lambda s: s
       
    39 
       
    40 LANGUAGES = ( 
       
    41     ('fr', ugettext('French')),
       
    42     ('en', ugettext('English')),
       
    43 )
       
    44 
       
    45 
       
    46 SITE_ID = 1
       
    47 
       
    48 # If you set this to False, Django will make some optimizations so as not
       
    49 # to load the internationalization machinery.
       
    50 USE_I18N = True
       
    51 
       
    52 # If you set this to False, Django will not format dates, numbers and
       
    53 # calendars according to the current locale.
       
    54 USE_L10N = True
       
    55 
       
    56 # If you set this to False, Django will not use timezone-aware datetimes.
       
    57 USE_TZ = True
       
    58 
       
    59 # Absolute filesystem path to the directory that will hold user-uploaded files.
       
    60 # Example: "/var/www/example.com/media/"
       
    61 MEDIA_ROOT = ''
       
    62 
       
    63 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
       
    64 # trailing slash.
       
    65 # Examples: "http://example.com/media/", "http://media.example.com/"
       
    66 MEDIA_URL = ''
       
    67 
       
    68 # Absolute path to the directory static files should be collected to.
       
    69 # Don't put anything in this directory yourself; store your static files
       
    70 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
       
    71 # Example: "/var/www/example.com/static/"
       
    72 STATIC_ROOT = ''
       
    73 
       
    74 # URL prefix for static files.
       
    75 # Example: "http://example.com/static/", "http://static.example.com/"
       
    76 STATIC_URL = '/static/'
       
    77 
       
    78 # Additional locations of static files
       
    79 STATICFILES_DIRS = (
       
    80     # Put strings here, like "/home/html/static" or "C:/www/django/static".
       
    81     # Always use forward slashes, even on Windows.
       
    82     # Don't forget to use absolute paths, not relative paths.
       
    83 )
       
    84 
       
    85 # List of finder classes that know how to find static files in
       
    86 # various locations.
       
    87 STATICFILES_FINDERS = (
       
    88     'django.contrib.staticfiles.finders.FileSystemFinder',
       
    89     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
       
    90 #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
       
    91 )
       
    92 
       
    93 # List of callables that know how to import templates from various sources.
       
    94 TEMPLATE_LOADERS = (
       
    95     'django.template.loaders.filesystem.Loader',
       
    96     'django.template.loaders.app_directories.Loader',
       
    97 #     'django.template.loaders.eggs.Loader',
       
    98 )
       
    99 
       
   100 MIDDLEWARE_CLASSES = (
       
   101     'django.middleware.common.CommonMiddleware',
       
   102     'django.contrib.sessions.middleware.SessionMiddleware',
       
   103     'django.middleware.csrf.CsrfViewMiddleware',
       
   104     'django.contrib.auth.middleware.AuthenticationMiddleware',
       
   105     'django.contrib.messages.middleware.MessageMiddleware',
       
   106     # Uncomment the next line for simple clickjacking protection:
       
   107     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
       
   108 )
       
   109 
       
   110 ROOT_URLCONF = 'p4l.urls'
       
   111 
       
   112 AUTH_USER_MODEL = 'p4l.User'
       
   113 INITIAL_CUSTOM_USER_MIGRATION = "0001_initial"
       
   114 
       
   115 
       
   116 # Python dotted path to the WSGI application used by Django's runserver.
       
   117 WSGI_APPLICATION = 'p4l.wsgi.application'
       
   118 
       
   119 TEMPLATE_DIRS = (
       
   120     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
       
   121     # Always use forward slashes, even on Windows.
       
   122     # Don't forget to use absolute paths, not relative paths.
       
   123 )
       
   124 
       
   125 INSTALLED_APPS = (
       
   126     'django.contrib.auth',
       
   127     'django.contrib.contenttypes',
       
   128     'django.contrib.sessions',
       
   129     'django.contrib.sites',
       
   130     'django.contrib.messages',
       
   131     'django.contrib.staticfiles',
       
   132     'django.contrib.admin',
       
   133     'south',
       
   134     'p4l'
       
   135 )
       
   136 
       
   137 # A sample logging configuration. The only tangible logging
       
   138 # performed by this configuration is to send an email to
       
   139 # the site admins on every HTTP 500 error when DEBUG=False.
       
   140 # See http://docs.djangoproject.com/en/dev/topics/logging for
       
   141 # more details on how to customize your logging configuration.
       
   142 LOGGING = {
       
   143     'version': 1,
       
   144     'disable_existing_loggers': False,
       
   145     'filters': {
       
   146         'require_debug_false': {
       
   147             '()': 'django.utils.log.RequireDebugFalse'
       
   148         }
       
   149     },
       
   150     'handlers': {
       
   151         'mail_admins': {
       
   152             'level': 'ERROR',
       
   153             'filters': ['require_debug_false'],
       
   154             'class': 'django.utils.log.AdminEmailHandler'
       
   155         }
       
   156     },
       
   157     'loggers': {
       
   158         'django.request': {
       
   159             'handlers': ['mail_admins'],
       
   160             'level': 'ERROR',
       
   161             'propagate': True,
       
   162         },
       
   163     }
       
   164 }
       
   165 
       
   166 from config import *  # @UnusedWildImport
       
   167 
       
   168 if not "SRC_BASE_URL" in locals():
       
   169     SRC_BASE_URL = BASE_URL + __name__.split('.')[0] + '/'