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