settings.py 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. # Django settings for hello project.
  2. DEBUG = False
  3. TEMPLATE_DEBUG = DEBUG
  4. ADMINS = (
  5. # ('Your Name', '[email protected]'),
  6. )
  7. MANAGERS = ADMINS
  8. DATABASES = {
  9. 'default': {
  10. 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
  11. 'NAME': 'hello_world', # Or path to database file if using sqlite3.
  12. 'USER': 'benchmarkdbuser', # Not used with sqlite3.
  13. 'PASSWORD': 'benchmarkdbpass', # Not used with sqlite3.
  14. 'HOST': 'localhost', # 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. # If you set this to False, Django will not use timezone-aware datetimes.
  37. USE_TZ = True
  38. # Absolute filesystem path to the directory that will hold user-uploaded files.
  39. # Example: "/home/media/media.lawrence.com/media/"
  40. MEDIA_ROOT = ''
  41. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  42. # trailing slash.
  43. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  44. MEDIA_URL = ''
  45. # Absolute path to the directory static files should be collected to.
  46. # Don't put anything in this directory yourself; store your static files
  47. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  48. # Example: "/home/media/media.lawrence.com/static/"
  49. STATIC_ROOT = ''
  50. # URL prefix for static files.
  51. # Example: "http://media.lawrence.com/static/"
  52. STATIC_URL = '/static/'
  53. # Additional locations of static files
  54. STATICFILES_DIRS = (
  55. # Put strings here, like "/home/html/static" or "C:/www/django/static".
  56. # Always use forward slashes, even on Windows.
  57. # Don't forget to use absolute paths, not relative paths.
  58. )
  59. # List of finder classes that know how to find static files in
  60. # various locations.
  61. STATICFILES_FINDERS = (
  62. 'django.contrib.staticfiles.finders.FileSystemFinder',
  63. 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  64. # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
  65. )
  66. # Make this unique, and don't share it with anybody.
  67. SECRET_KEY = '_7mb6#v4yf@qhc(r(zbyh&z_iby-na*7wz&-v6pohsul-d#y5f'
  68. # List of callables that know how to import templates from various sources.
  69. TEMPLATE_LOADERS = (
  70. ('django.template.loaders.cached.Loader', (
  71. 'django.template.loaders.filesystem.Loader',
  72. 'django.template.loaders.app_directories.Loader',
  73. ))
  74. )
  75. MIDDLEWARE_CLASSES = (
  76. # In our optimized version, we can remove this middleware that we're not using
  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 = 'hello.urls'
  84. # Python dotted path to the WSGI application used by Django's runserver.
  85. WSGI_APPLICATION = 'hello.wsgi.application'
  86. TEMPLATE_DIRS = (
  87. # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
  88. # Always use forward slashes, even on Windows.
  89. # Don't forget to use absolute paths, not relative paths.
  90. "/home/ubuntu/FrameworkBenchmarks/django/hello/templates",
  91. )
  92. INSTALLED_APPS = (
  93. # Removing these for our optimized version
  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. }