settings.py 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. # Django settings for hello project.
  2. import os
  3. DEBUG = False
  4. TEMPLATE_DEBUG = DEBUG
  5. ADMINS = (
  6. # ('Your Name', '[email protected]'),
  7. )
  8. MANAGERS = ADMINS
  9. DATABASES = {
  10. 'default': {
  11. 'ENGINE': 'django.db.backends.' + os.environ['DJANGO_DB'], # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
  12. 'NAME': 'hello_world', # Or path to database file if using sqlite3.
  13. 'USER': 'benchmarkdbuser', # Not used with sqlite3.
  14. 'PASSWORD': 'benchmarkdbpass', # Not used with sqlite3.
  15. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
  16. 'PORT': '', # Set to empty string for default. Not used with sqlite3.
  17. 'CONN_MAX_AGE': 30,
  18. }
  19. }
  20. # Local time zone for this installation. Choices can be found here:
  21. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  22. # although not all choices may be available on all operating systems.
  23. # On Unix systems, a value of None will cause Django to use the same
  24. # timezone as the operating system.
  25. # If running in a Windows environment this must be set to the same as your
  26. # system time zone.
  27. TIME_ZONE = 'America/Chicago'
  28. # Language code for this installation. All choices can be found here:
  29. # http://www.i18nguy.com/unicode/language-identifiers.html
  30. LANGUAGE_CODE = 'en-us'
  31. SITE_ID = 1
  32. # If you set this to False, Django will make some optimizations so as not
  33. # to load the internationalization machinery.
  34. USE_I18N = False
  35. # If you set this to False, Django will not format dates, numbers and
  36. # calendars according to the current locale.
  37. USE_L10N = False
  38. # If you set this to False, Django will not use timezone-aware datetimes.
  39. USE_TZ = False
  40. # Absolute filesystem path to the directory that will hold user-uploaded files.
  41. # Example: "/home/media/media.lawrence.com/media/"
  42. MEDIA_ROOT = ''
  43. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  44. # trailing slash.
  45. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  46. MEDIA_URL = ''
  47. # Absolute path to the directory static files should be collected to.
  48. # Don't put anything in this directory yourself; store your static files
  49. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  50. # Example: "/home/media/media.lawrence.com/static/"
  51. STATIC_ROOT = ''
  52. # URL prefix for static files.
  53. # Example: "http://media.lawrence.com/static/"
  54. STATIC_URL = '/static/'
  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 = '_7mb6#v4yf@qhc(r(zbyh&z_iby-na*7wz&-v6pohsul-d#y5f'
  70. # List of callables that know how to import templates from various sources.
  71. TEMPLATE_LOADERS = (
  72. ('django.template.loaders.cached.Loader', (
  73. 'django.template.loaders.filesystem.Loader',
  74. 'django.template.loaders.app_directories.Loader',
  75. )),
  76. )
  77. MIDDLEWARE_CLASSES = (
  78. 'django.middleware.common.CommonMiddleware',
  79. 'django.contrib.sessions.middleware.SessionMiddleware',
  80. 'django.middleware.csrf.CsrfViewMiddleware',
  81. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  82. 'django.contrib.messages.middleware.MessageMiddleware',
  83. )
  84. ROOT_URLCONF = 'hello.urls'
  85. # Python dotted path to the WSGI application used by Django's runserver.
  86. WSGI_APPLICATION = 'hello.wsgi.application'
  87. TEMPLATE_DIRS = (
  88. # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
  89. # Always use forward slashes, even on Windows.
  90. # Don't forget to use absolute paths, not relative paths.
  91. "/home/hyoung/FrameworkBenchmarks/django/hello/templates",
  92. )
  93. INSTALLED_APPS = (
  94. 'django.contrib.auth',
  95. 'django.contrib.contenttypes',
  96. 'django.contrib.sessions',
  97. 'django.contrib.sites',
  98. 'django.contrib.messages',
  99. 'django.contrib.staticfiles',
  100. # Uncomment the next line to enable the admin:
  101. # 'django.contrib.admin',
  102. # Uncomment the next line to enable admin documentation:
  103. # 'django.contrib.admindocs',
  104. 'world',
  105. )
  106. # A sample logging configuration. The only tangible logging
  107. # performed by this configuration is to send an email to
  108. # the site admins on every HTTP 500 error when DEBUG=False.
  109. # See http://docs.djangoproject.com/en/dev/topics/logging for
  110. # more details on how to customize your logging configuration.
  111. LOGGING = {
  112. 'version': 1,
  113. 'disable_existing_loggers': True,
  114. 'formatters': {
  115. 'verbose': {
  116. 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
  117. },
  118. 'simple': {
  119. 'format': '%(levelname)s %(message)s'
  120. },
  121. },
  122. 'filters': {
  123. 'require_debug_false': {
  124. '()': 'django.utils.log.RequireDebugFalse'
  125. }
  126. },
  127. 'handlers': {
  128. 'mail_admins': {
  129. 'level': 'ERROR',
  130. 'filters': ['require_debug_false'],
  131. 'class': 'django.utils.log.AdminEmailHandler'
  132. },
  133. 'console':{
  134. 'level': 'ERROR',
  135. 'class': 'logging.StreamHandler',
  136. 'formatter': 'simple'
  137. },
  138. },
  139. 'loggers': {
  140. 'django.request': {
  141. 'handlers': ['mail_admins', 'console'],
  142. 'level': 'ERROR',
  143. 'propagate': True,
  144. },
  145. }
  146. }
  147. ALLOWED_HOSTS = ['*']