app/django/conf/global_settings.py
changeset 54 03e267d67478
child 323 ff1a9aa48cfd
equal deleted inserted replaced
53:57b4279d8c4e 54:03e267d67478
       
     1 # Default Django settings. Override these with settings in the module
       
     2 # pointed-to by the DJANGO_SETTINGS_MODULE environment variable.
       
     3 
       
     4 # This is defined here as a do-nothing function because we can't import
       
     5 # django.utils.translation -- that module depends on the settings.
       
     6 gettext_noop = lambda s: s
       
     7 
       
     8 ####################
       
     9 # CORE             #
       
    10 ####################
       
    11 
       
    12 DEBUG = False
       
    13 TEMPLATE_DEBUG = False
       
    14 # True if BaseHandler.get_response() should propagate raw exceptions
       
    15 # rather than catching them.  This is useful under some testing siutations,
       
    16 # and should never be used on a live site.
       
    17 DEBUG_PROPAGATE_EXCEPTIONS = False
       
    18 
       
    19 # Whether to use the "Etag" header. This saves bandwidth but slows down performance.
       
    20 USE_ETAGS = False
       
    21 
       
    22 # People who get code error notifications.
       
    23 # In the format (('Full Name', 'email@domain.com'), ('Full Name', 'anotheremail@domain.com'))
       
    24 ADMINS = ()
       
    25 
       
    26 # Tuple of IP addresses, as strings, that:
       
    27 #   * See debug comments, when DEBUG is true
       
    28 #   * Receive x-headers
       
    29 INTERNAL_IPS = ()
       
    30 
       
    31 # Local time zone for this installation. All choices can be found here:
       
    32 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name (although not all
       
    33 # systems may support all possibilities).
       
    34 TIME_ZONE = 'America/Chicago'
       
    35 
       
    36 # Language code for this installation. All choices can be found here:
       
    37 # http://www.i18nguy.com/unicode/language-identifiers.html
       
    38 LANGUAGE_CODE = 'en-us'
       
    39 
       
    40 # Languages we provide translations for, out of the box. The language name
       
    41 # should be the utf-8 encoded local name for the language.
       
    42 LANGUAGES = (
       
    43     ('ar', gettext_noop('Arabic')),
       
    44     ('bn', gettext_noop('Bengali')),
       
    45     ('bg', gettext_noop('Bulgarian')),
       
    46     ('ca', gettext_noop('Catalan')),
       
    47     ('cs', gettext_noop('Czech')),
       
    48     ('cy', gettext_noop('Welsh')),
       
    49     ('da', gettext_noop('Danish')),
       
    50     ('de', gettext_noop('German')),
       
    51     ('el', gettext_noop('Greek')),
       
    52     ('en', gettext_noop('English')),
       
    53     ('es', gettext_noop('Spanish')),
       
    54     ('es-ar', gettext_noop('Argentinean Spanish')),
       
    55     ('eu', gettext_noop('Basque')),
       
    56     ('fa', gettext_noop('Persian')),
       
    57     ('fi', gettext_noop('Finnish')),
       
    58     ('fr', gettext_noop('French')),
       
    59     ('ga', gettext_noop('Irish')),
       
    60     ('gl', gettext_noop('Galician')),
       
    61     ('hu', gettext_noop('Hungarian')),
       
    62     ('he', gettext_noop('Hebrew')),
       
    63     ('hr', gettext_noop('Croatian')),
       
    64     ('is', gettext_noop('Icelandic')),
       
    65     ('it', gettext_noop('Italian')),
       
    66     ('ja', gettext_noop('Japanese')),
       
    67     ('ka', gettext_noop('Georgian')),
       
    68     ('ko', gettext_noop('Korean')),
       
    69     ('km', gettext_noop('Khmer')),
       
    70     ('kn', gettext_noop('Kannada')),
       
    71     ('lv', gettext_noop('Latvian')),
       
    72     ('mk', gettext_noop('Macedonian')),
       
    73     ('nl', gettext_noop('Dutch')),
       
    74     ('no', gettext_noop('Norwegian')),
       
    75     ('pl', gettext_noop('Polish')),
       
    76     ('pt', gettext_noop('Portugese')),
       
    77     ('pt-br', gettext_noop('Brazilian Portuguese')),
       
    78     ('ro', gettext_noop('Romanian')),
       
    79     ('ru', gettext_noop('Russian')),
       
    80     ('sk', gettext_noop('Slovak')),
       
    81     ('sl', gettext_noop('Slovenian')),
       
    82     ('sr', gettext_noop('Serbian')),
       
    83     ('sv', gettext_noop('Swedish')),
       
    84     ('ta', gettext_noop('Tamil')),
       
    85     ('te', gettext_noop('Telugu')),
       
    86     ('tr', gettext_noop('Turkish')),
       
    87     ('uk', gettext_noop('Ukrainian')),
       
    88     ('zh-cn', gettext_noop('Simplified Chinese')),
       
    89     ('zh-tw', gettext_noop('Traditional Chinese')),
       
    90 )
       
    91 
       
    92 # Languages using BiDi (right-to-left) layout
       
    93 LANGUAGES_BIDI = ("he", "ar", "fa")
       
    94 
       
    95 # If you set this to False, Django will make some optimizations so as not
       
    96 # to load the internationalization machinery.
       
    97 USE_I18N = True
       
    98 LOCALE_PATHS = ()
       
    99 LANGUAGE_COOKIE_NAME = 'django_language'
       
   100 
       
   101 # Not-necessarily-technical managers of the site. They get broken link
       
   102 # notifications and other various e-mails.
       
   103 MANAGERS = ADMINS
       
   104 
       
   105 # Default content type and charset to use for all HttpResponse objects, if a
       
   106 # MIME type isn't manually specified. These are used to construct the
       
   107 # Content-Type header.
       
   108 DEFAULT_CONTENT_TYPE = 'text/html'
       
   109 DEFAULT_CHARSET = 'utf-8'
       
   110 
       
   111 # Encoding of files read from disk (template and initial SQL files).
       
   112 FILE_CHARSET = 'utf-8'
       
   113 
       
   114 # E-mail address that error messages come from.
       
   115 SERVER_EMAIL = 'root@localhost'
       
   116 
       
   117 # Whether to send broken-link e-mails.
       
   118 SEND_BROKEN_LINK_EMAILS = False
       
   119 
       
   120 # Database connection info.
       
   121 DATABASE_ENGINE = ''           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
       
   122 DATABASE_NAME = ''             # Or path to database file if using sqlite3.
       
   123 DATABASE_USER = ''             # Not used with sqlite3.
       
   124 DATABASE_PASSWORD = ''         # Not used with sqlite3.
       
   125 DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
       
   126 DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.
       
   127 DATABASE_OPTIONS = {}          # Set to empty dictionary for default.
       
   128 
       
   129 # Host for sending e-mail.
       
   130 EMAIL_HOST = 'localhost'
       
   131 
       
   132 # Port for sending e-mail.
       
   133 EMAIL_PORT = 25
       
   134 
       
   135 # Optional SMTP authentication information for EMAIL_HOST.
       
   136 EMAIL_HOST_USER = ''
       
   137 EMAIL_HOST_PASSWORD = ''
       
   138 EMAIL_USE_TLS = False
       
   139 
       
   140 # List of strings representing installed apps.
       
   141 INSTALLED_APPS = ()
       
   142 
       
   143 # List of locations of the template source files, in search order.
       
   144 TEMPLATE_DIRS = ()
       
   145 
       
   146 # List of callables that know how to import templates from various sources.
       
   147 # See the comments in django/core/template/loader.py for interface
       
   148 # documentation.
       
   149 TEMPLATE_LOADERS = (
       
   150     'django.template.loaders.filesystem.load_template_source',
       
   151     'django.template.loaders.app_directories.load_template_source',
       
   152 #     'django.template.loaders.eggs.load_template_source',
       
   153 )
       
   154 
       
   155 # List of processors used by RequestContext to populate the context.
       
   156 # Each one should be a callable that takes the request object as its
       
   157 # only parameter and returns a dictionary to add to the context.
       
   158 TEMPLATE_CONTEXT_PROCESSORS = (
       
   159     'django.core.context_processors.auth',
       
   160     'django.core.context_processors.debug',
       
   161     'django.core.context_processors.i18n',
       
   162     'django.core.context_processors.media',
       
   163 #    'django.core.context_processors.request',
       
   164 )
       
   165 
       
   166 # Output to use in template system for invalid (e.g. misspelled) variables.
       
   167 TEMPLATE_STRING_IF_INVALID = ''
       
   168 
       
   169 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
       
   170 # trailing slash.
       
   171 # Examples: "http://foo.com/media/", "/media/".
       
   172 ADMIN_MEDIA_PREFIX = '/media/'
       
   173 
       
   174 # Default e-mail address to use for various automated correspondence from
       
   175 # the site managers.
       
   176 DEFAULT_FROM_EMAIL = 'webmaster@localhost'
       
   177 
       
   178 # Subject-line prefix for email messages send with django.core.mail.mail_admins
       
   179 # or ...mail_managers.  Make sure to include the trailing space.
       
   180 EMAIL_SUBJECT_PREFIX = '[Django] '
       
   181 
       
   182 # Whether to append trailing slashes to URLs.
       
   183 APPEND_SLASH = True
       
   184 
       
   185 # Whether to prepend the "www." subdomain to URLs that don't have it.
       
   186 PREPEND_WWW = False
       
   187 
       
   188 # List of compiled regular expression objects representing User-Agent strings
       
   189 # that are not allowed to visit any page, systemwide. Use this for bad
       
   190 # robots/crawlers. Here are a few examples:
       
   191 #     import re
       
   192 #     DISALLOWED_USER_AGENTS = (
       
   193 #         re.compile(r'^NaverBot.*'),
       
   194 #         re.compile(r'^EmailSiphon.*'),
       
   195 #         re.compile(r'^SiteSucker.*'),
       
   196 #         re.compile(r'^sohu-search')
       
   197 #     )
       
   198 DISALLOWED_USER_AGENTS = ()
       
   199 
       
   200 ABSOLUTE_URL_OVERRIDES = {}
       
   201 
       
   202 # Tuple of strings representing allowed prefixes for the {% ssi %} tag.
       
   203 # Example: ('/home/html', '/var/www')
       
   204 ALLOWED_INCLUDE_ROOTS = ()
       
   205 
       
   206 # If this is a admin settings module, this should be a list of
       
   207 # settings modules (in the format 'foo.bar.baz') for which this admin
       
   208 # is an admin.
       
   209 ADMIN_FOR = ()
       
   210 
       
   211 # 404s that may be ignored.
       
   212 IGNORABLE_404_STARTS = ('/cgi-bin/', '/_vti_bin', '/_vti_inf')
       
   213 IGNORABLE_404_ENDS = ('mail.pl', 'mailform.pl', 'mail.cgi', 'mailform.cgi', 'favicon.ico', '.php')
       
   214 
       
   215 # A secret key for this particular Django installation. Used in secret-key
       
   216 # hashing algorithms. Set this in your settings, or Django will complain
       
   217 # loudly.
       
   218 SECRET_KEY = ''
       
   219 
       
   220 # Path to the "jing" executable -- needed to validate XMLFields
       
   221 JING_PATH = "/usr/bin/jing"
       
   222 
       
   223 # Absolute path to the directory that holds media.
       
   224 # Example: "/home/media/media.lawrence.com/"
       
   225 MEDIA_ROOT = ''
       
   226 
       
   227 # URL that handles the media served from MEDIA_ROOT.
       
   228 # Example: "http://media.lawrence.com"
       
   229 MEDIA_URL = ''
       
   230 
       
   231 # Default formatting for date objects. See all available format strings here:
       
   232 # http://www.djangoproject.com/documentation/templates/#now
       
   233 DATE_FORMAT = 'N j, Y'
       
   234 
       
   235 # Default formatting for datetime objects. See all available format strings here:
       
   236 # http://www.djangoproject.com/documentation/templates/#now
       
   237 DATETIME_FORMAT = 'N j, Y, P'
       
   238 
       
   239 # Default formatting for time objects. See all available format strings here:
       
   240 # http://www.djangoproject.com/documentation/templates/#now
       
   241 TIME_FORMAT = 'P'
       
   242 
       
   243 # Default formatting for date objects when only the year and month are relevant.
       
   244 # See all available format strings here:
       
   245 # http://www.djangoproject.com/documentation/templates/#now
       
   246 YEAR_MONTH_FORMAT = 'F Y'
       
   247 
       
   248 # Default formatting for date objects when only the month and day are relevant.
       
   249 # See all available format strings here:
       
   250 # http://www.djangoproject.com/documentation/templates/#now
       
   251 MONTH_DAY_FORMAT = 'F j'
       
   252 
       
   253 # Do you want to manage transactions manually?
       
   254 # Hint: you really don't!
       
   255 TRANSACTIONS_MANAGED = False
       
   256 
       
   257 # The User-Agent string to use when checking for URL validity through the
       
   258 # isExistingURL validator.
       
   259 from django import get_version
       
   260 URL_VALIDATOR_USER_AGENT = "Django/%s (http://www.djangoproject.com)" % get_version()
       
   261 
       
   262 # The tablespaces to use for each model when not specified otherwise.
       
   263 DEFAULT_TABLESPACE = ''
       
   264 DEFAULT_INDEX_TABLESPACE = ''
       
   265 
       
   266 ##############
       
   267 # MIDDLEWARE #
       
   268 ##############
       
   269 
       
   270 # List of middleware classes to use.  Order is important; in the request phase,
       
   271 # this middleware classes will be applied in the order given, and in the
       
   272 # response phase the middleware will be applied in reverse order.
       
   273 MIDDLEWARE_CLASSES = (
       
   274     'django.contrib.sessions.middleware.SessionMiddleware',
       
   275     'django.contrib.auth.middleware.AuthenticationMiddleware',
       
   276 #     'django.middleware.http.ConditionalGetMiddleware',
       
   277 #     'django.middleware.gzip.GZipMiddleware',
       
   278     'django.middleware.common.CommonMiddleware',
       
   279     'django.middleware.doc.XViewMiddleware',
       
   280 )
       
   281 
       
   282 ############
       
   283 # SESSIONS #
       
   284 ############
       
   285 
       
   286 SESSION_COOKIE_NAME = 'sessionid'                       # Cookie name. This can be whatever you want.
       
   287 SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2               # Age of cookie, in seconds (default: 2 weeks).
       
   288 SESSION_COOKIE_DOMAIN = None                            # A string like ".lawrence.com", or None for standard domain cookie.
       
   289 SESSION_COOKIE_SECURE = False                           # Whether the session cookie should be secure (https:// only).
       
   290 SESSION_COOKIE_PATH = '/'                               # The path of the session cookie.
       
   291 SESSION_SAVE_EVERY_REQUEST = False                      # Whether to save the session data on every request.
       
   292 SESSION_EXPIRE_AT_BROWSER_CLOSE = False                 # Whether sessions expire when a user closes his browser.
       
   293 SESSION_ENGINE = 'django.contrib.sessions.backends.db'  # The module to store session data
       
   294 SESSION_FILE_PATH = None                                # Directory to store session files if using the file session module. If None, the backend will use a sensible default.
       
   295 
       
   296 #########
       
   297 # CACHE #
       
   298 #########
       
   299 
       
   300 # The cache backend to use.  See the docstring in django.core.cache for the
       
   301 # possible values.
       
   302 CACHE_BACKEND = 'locmem://'
       
   303 CACHE_MIDDLEWARE_KEY_PREFIX = ''
       
   304 CACHE_MIDDLEWARE_SECONDS = 600
       
   305 
       
   306 ####################
       
   307 # COMMENTS         #
       
   308 ####################
       
   309 
       
   310 COMMENTS_ALLOW_PROFANITIES = False
       
   311 
       
   312 # The profanities that will trigger a validation error in the
       
   313 # 'hasNoProfanities' validator. All of these should be in lowercase.
       
   314 PROFANITIES_LIST = ('asshat', 'asshead', 'asshole', 'cunt', 'fuck', 'gook', 'nigger', 'shit')
       
   315 
       
   316 # The group ID that designates which users are banned.
       
   317 # Set to None if you're not using it.
       
   318 COMMENTS_BANNED_USERS_GROUP = None
       
   319 
       
   320 # The group ID that designates which users can moderate comments.
       
   321 # Set to None if you're not using it.
       
   322 COMMENTS_MODERATORS_GROUP = None
       
   323 
       
   324 # The group ID that designates the users whose comments should be e-mailed to MANAGERS.
       
   325 # Set to None if you're not using it.
       
   326 COMMENTS_SKETCHY_USERS_GROUP = None
       
   327 
       
   328 # The system will e-mail MANAGERS the first COMMENTS_FIRST_FEW comments by each
       
   329 # user. Set this to 0 if you want to disable it.
       
   330 COMMENTS_FIRST_FEW = 0
       
   331 
       
   332 # A tuple of IP addresses that have been banned from participating in various
       
   333 # Django-powered features.
       
   334 BANNED_IPS = ()
       
   335 
       
   336 ##################
       
   337 # AUTHENTICATION #
       
   338 ##################
       
   339 
       
   340 AUTHENTICATION_BACKENDS = ('django.contrib.auth.backends.ModelBackend',)
       
   341 
       
   342 LOGIN_URL = '/accounts/login/'
       
   343 
       
   344 LOGOUT_URL = '/accounts/logout/'
       
   345 
       
   346 LOGIN_REDIRECT_URL = '/accounts/profile/'
       
   347 
       
   348 ###########
       
   349 # TESTING #
       
   350 ###########
       
   351 
       
   352 # The name of the method to use to invoke the test suite
       
   353 TEST_RUNNER = 'django.test.simple.run_tests'
       
   354 
       
   355 # The name of the database to use for testing purposes.
       
   356 # If None, a name of 'test_' + DATABASE_NAME will be assumed
       
   357 TEST_DATABASE_NAME = None
       
   358 
       
   359 # Strings used to set the character set and collation order for the test
       
   360 # database. These values are passed literally to the server, so they are
       
   361 # backend-dependent. If None, no special settings are sent (system defaults are
       
   362 # used).
       
   363 TEST_DATABASE_CHARSET = None
       
   364 TEST_DATABASE_COLLATION = None
       
   365 
       
   366 ############
       
   367 # FIXTURES #
       
   368 ############
       
   369 
       
   370 # The list of directories to search for fixtures
       
   371 FIXTURE_DIRS = ()