a | b | |
---|
| 0 | + | # -*- coding: utf-8 -*- |
---|
| 0 | + | # Django settings. |
---|
| 0 | + | import sys, os.path, posixpath |
---|
| 0 | + | |
---|
| 0 | + | #================================== PROJECT ==================================== |
---|
| 0 | + | PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) |
---|
| 0 | + | |
---|
| 0 | + | |
---|
| 0 | + | ADMINS = ( |
---|
| 0 | + | ('Admin', '<admin@email.com>'), |
---|
| 0 | + | ) |
---|
| 0 | + | |
---|
| 0 | + | MANAGERS = ADMINS |
---|
| 0 | + | |
---|
| 0 | + | |
---|
| 0 | + | DATABASES = { |
---|
| 0 | + | 'default': { |
---|
| 0 | + | 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
---|
| 0 | + | 'NAME': '<dbname>', # Or path to database file if using sqlite3. |
---|
| 0 | + | 'USER': '<dbuser>', # Not used with sqlite3. |
---|
| 0 | + | 'PASSWORD': '<dbpassword>', # Not used with sqlite3. |
---|
| 0 | + | 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. |
---|
| 0 | + | 'PORT': '', # Set to empty string for default. Not used with sqlite3. |
---|
| 0 | + | } |
---|
| 0 | + | } |
---|
| 0 | + | |
---|
| 0 | + | # Make this unique, and don't share it with anybody. |
---|
| 0 | + | SECRET_KEY = '<your-secret>' |
---|
| 0 | + | |
---|
| 0 | + | |
---|
| 0 | + | ROOT_URLCONF = '<your-project-name>.urls' |
---|
| 0 | + | |
---|
| 0 | + | #================================ DEBUGGING ==================================== |
---|
| 0 | + | DEBUG = True |
---|
| 0 | + | TEMPLATE_DEBUG = DEBUG |
---|
| 0 | + | |
---|
| 0 | + | INTERNAL_IPS = ( |
---|
| 0 | + | '127.0.0.1', |
---|
| 0 | + | ) |
---|
| 0 | + | |
---|
| 0 | + | DEBUG_TOOLBAR_CONFIG ={ |
---|
| 0 | + | 'INTERCEPT_REDIRECTS': False |
---|
| 0 | + | } |
---|
| 0 | + | |
---|
| 0 | + | |
---|
| 0 | + | #========================== LOCALIZATION AND TIMEZONE ========================== |
---|
| 0 | + | |
---|
| 0 | + | # Local time zone for this installation. Choices can be found here: |
---|
| 0 | + | # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
---|
| 0 | + | # although not all choices may be available on all operating systems. |
---|
| 0 | + | # On Unix systems, a value of None will cause Django to use the same |
---|
| 0 | + | # timezone as the operating system. |
---|
| 0 | + | # If running in a Windows environment this must be set to the same as your |
---|
| 0 | + | # system time zone. |
---|
| 0 | + | #TIME_ZONE = 'America/Chicago' |
---|
| 0 | + | TIME_ZONE = 'Europe/Paris' |
---|
| 0 | + | |
---|
| 0 | + | # Language code for this installation. All choices can be found here: |
---|
| 0 | + | # http://www.i18nguy.com/unicode/language-identifiers.html |
---|
| 0 | + | #LANGUAGE_CODE = 'en-us' |
---|
| 0 | + | LANGUAGE_CODE = 'fr' |
---|
| 0 | + | |
---|
| 0 | + | |
---|
| 0 | + | # If you set this to False, Django will make some optimizations so as not |
---|
| 0 | + | # to load the internationalization machinery. |
---|
| 0 | + | USE_I18N = True |
---|
| 0 | + | |
---|
| 0 | + | # If you set this to False, Django will not format dates, numbers and |
---|
| 0 | + | # calendars according to the current locale |
---|
| 0 | + | USE_L10N = True |
---|
| 0 | + | |
---|
| 0 | + | SITE_ID = 1 |
---|
| 0 | + | |
---|
| 0 | + | |
---|
| 0 | + | |
---|
| 0 | + | #==================================== MEDIA ==================================== |
---|
| 0 | + | |
---|
| 0 | + | # Absolute path to the directory that holds media. |
---|
| 0 | + | # Example: "/home/media/media.lawrence.com/" |
---|
| 0 | + | MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'site_media') |
---|
| 0 | + | |
---|
| 0 | + | # URL that handles the media served from MEDIA_ROOT. |
---|
| 0 | + | # Example: "http://media.lawrence.com" |
---|
| 0 | + | MEDIA_URL = '/site_media/media/' |
---|
| 0 | + | |
---|
| 0 | + | # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
---|
| 0 | + | # trailing slash. |
---|
| 0 | + | # Examples: "http://foo.com/media/", "/media/". |
---|
| 0 | + | ADMIN_MEDIA_PREFIX = '/media/' |
---|
| 0 | + | |
---|
| 0 | + | |
---|
| 0 | + | #================================== TEMPLATES ================================== |
---|
| 0 | + | |
---|
| 0 | + | # List of callables that know how to import templates from various sources. |
---|
| 0 | + | TEMPLATE_LOADERS = ( |
---|
| 0 | + | 'django.template.loaders.filesystem.Loader', |
---|
| 0 | + | 'django.template.loaders.app_directories.Loader', |
---|
| 0 | + | 'django.template.loaders.eggs.load_template_source', |
---|
| 0 | + | ) |
---|
| 0 | + | |
---|
| 0 | + | |
---|
| 0 | + | TEMPLATE_DIRS = ( |
---|
| 0 | + | # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
---|
| 0 | + | # Always use forward slashes, even on Windows. |
---|
| 0 | + | # Don't forget to use absolute paths, not relative paths. |
---|
| 0 | + | os.path.join(PROJECT_ROOT, "templates"), |
---|
| 0 | + | ) |
---|
| 0 | + | |
---|
| 0 | + | #============================ APPS SPECIFIC SETTINGS =========================== |
---|
| 0 | + | |
---|
| 0 | + | MIDDLEWARE_CLASSES = ( |
---|
| 0 | + | 'django.middleware.common.CommonMiddleware', |
---|
| 0 | + | 'django.contrib.sessions.middleware.SessionMiddleware', |
---|
| 0 | + | 'django.middleware.csrf.CsrfViewMiddleware', |
---|
| 0 | + | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
---|
| 0 | + | 'django.contrib.messages.middleware.MessageMiddleware', |
---|
| 0 | + | 'debug_toolbar.middleware.DebugToolbarMiddleware', |
---|
| 0 | + | ) |
---|
| 0 | + | |
---|
| 0 | + | #============================ APPS SPECIFIC SETTINGS =========================== |
---|
| 0 | + | |
---|
| 0 | + | #==================================== APPS ===================================== |
---|
| 0 | + | |
---|
| 0 | + | INSTALLED_APPS = ( |
---|
| 0 | + | # django contrib apps |
---|
| 0 | + | 'django.contrib.auth', |
---|
| 0 | + | 'django.contrib.contenttypes', |
---|
| 0 | + | 'django.contrib.sessions', |
---|
| 0 | + | 'django.contrib.sites', |
---|
| 0 | + | 'django.contrib.messages', |
---|
| 0 | + | 'django.contrib.admin', |
---|
| 0 | + | |
---|
| 0 | + | # reusable apps |
---|
| 0 | + | 'debug_toolbar', |
---|
| 0 | + | |
---|
| 0 | + | # project apps |
---|
| 0 | + | 'base_pro', |
---|
| 0 | + | ) |
---|
... | |
---|