Package django :: Package conf :: Module global_settings
[hide private]
[frames] | no frames]

Source Code for Module django.conf.global_settings

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