PageRenderTime 28ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/django/conf/project_template/settings.py

https://code.google.com/p/mango-py/
Python | 152 lines | 127 code | 8 blank | 17 comment | 0 complexity | 7cae12b0a0fe7be99ac179a61180d4b9 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. # Django settings for {{ project_name }} project.
  2. DEBUG = True
  3. TEMPLATE_DEBUG = DEBUG
  4. ADMINS = (
  5. # ('Your Name', 'your_email@example.com'),
  6. )
  7. MANAGERS = ADMINS
  8. DATABASES = {
  9. 'default': {
  10. 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
  11. 'NAME': '', # Or path to database file if using sqlite3.
  12. 'USER': '', # Not used with sqlite3.
  13. 'PASSWORD': '', # Not used with sqlite3.
  14. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
  15. 'PORT': '', # Set to empty string for default. Not used with sqlite3.
  16. }
  17. }
  18. # Local time zone for this installation. Choices can be found here:
  19. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  20. # although not all choices may be available on all operating systems.
  21. # On Unix systems, a value of None will cause Django to use the same
  22. # timezone as the operating system.
  23. # If running in a Windows environment this must be set to the same as your
  24. # system time zone.
  25. TIME_ZONE = 'America/Chicago'
  26. # Language code for this installation. All choices can be found here:
  27. # http://www.i18nguy.com/unicode/language-identifiers.html
  28. LANGUAGE_CODE = 'en-us'
  29. SITE_ID = 1
  30. # If you set this to False, Django will make some optimizations so as not
  31. # to load the internationalization machinery.
  32. USE_I18N = True
  33. # If you set this to False, Django will not format dates, numbers and
  34. # calendars according to the current locale
  35. USE_L10N = True
  36. # Absolute filesystem path to the directory that will hold user-uploaded files.
  37. # Example: "/home/media/media.lawrence.com/media/"
  38. MEDIA_ROOT = ''
  39. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  40. # trailing slash.
  41. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  42. MEDIA_URL = ''
  43. # Absolute path to the directory static files should be collected to.
  44. # Don't put anything in this directory yourself; store your static files
  45. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  46. # Example: "/home/media/media.lawrence.com/static/"
  47. STATIC_ROOT = ''
  48. # URL prefix for static files.
  49. # Example: "http://media.lawrence.com/static/"
  50. STATIC_URL = '/static/'
  51. # URL prefix for admin static files -- CSS, JavaScript and images.
  52. # Make sure to use a trailing slash.
  53. # Examples: "http://foo.com/static/admin/", "/static/admin/".
  54. ADMIN_MEDIA_PREFIX = '/static/admin/'
  55. # Additional locations of static files
  56. STATICFILES_DIRS = (
  57. # Put strings here, like "/home/html/static" or "C:/www/django/static".
  58. # Always use forward slashes, even on Windows.
  59. # Don't forget to use absolute paths, not relative paths.
  60. )
  61. # List of finder classes that know how to find static files in
  62. # various locations.
  63. STATICFILES_FINDERS = (
  64. 'django.contrib.staticfiles.finders.FileSystemFinder',
  65. 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  66. # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
  67. )
  68. # Make this unique, and don't share it with anybody.
  69. SECRET_KEY = ''
  70. # List of callables that know how to import templates from various sources.
  71. TEMPLATE_LOADERS = (
  72. 'django.template.loaders.filesystem.Loader',
  73. 'django.template.loaders.app_directories.Loader',
  74. # 'django.template.loaders.eggs.Loader',
  75. )
  76. MIDDLEWARE_CLASSES = (
  77. 'django.middleware.common.CommonMiddleware',
  78. 'django.contrib.sessions.middleware.SessionMiddleware',
  79. 'django.middleware.csrf.CsrfViewMiddleware',
  80. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  81. 'django.contrib.messages.middleware.MessageMiddleware',
  82. )
  83. ROOT_URLCONF = '{{ project_name }}.urls'
  84. TEMPLATE_DIRS = (
  85. # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
  86. # Always use forward slashes, even on Windows.
  87. # Don't forget to use absolute paths, not relative paths.
  88. )
  89. INSTALLED_APPS = (
  90. 'django.contrib.auth',
  91. 'django.contrib.contenttypes',
  92. 'django.contrib.sessions',
  93. 'django.contrib.sites',
  94. 'django.contrib.messages',
  95. 'django.contrib.staticfiles',
  96. # Uncomment the next line to enable the admin:
  97. # 'django.contrib.admin',
  98. # Uncomment the next line to enable admin documentation:
  99. # 'django.contrib.admindocs',
  100. )
  101. # A sample logging configuration. The only tangible logging
  102. # performed by this configuration is to send an email to
  103. # the site admins on every HTTP 500 error when DEBUG=False.
  104. # See http://docs.djangoproject.com/en/dev/topics/logging for
  105. # more details on how to customize your logging configuration.
  106. LOGGING = {
  107. 'version': 1,
  108. 'disable_existing_loggers': False,
  109. 'filters': {
  110. 'require_debug_false': {
  111. '()': 'django.utils.log.CallbackFilter',
  112. 'callback': lambda r: not DEBUG
  113. }
  114. },
  115. 'handlers': {
  116. 'mail_admins': {
  117. 'level': 'ERROR',
  118. 'filters': ['require_debug_false'],
  119. 'class': 'django.utils.log.AdminEmailHandler'
  120. }
  121. },
  122. 'loggers': {
  123. 'django.request': {
  124. 'handlers': ['mail_admins'],
  125. 'level': 'ERROR',
  126. 'propagate': True,
  127. },
  128. }
  129. }