/settings.py

http://diamanda.googlecode.com/ · Python · 159 lines · 88 code · 26 blank · 45 comment · 0 complexity · 93b2ba52099a12b7417c5d9379c4bde0 MD5 · raw file

  1. # Django settings for forumapp project.
  2. import os.path
  3. DEBUG = True
  4. TEMPLATE_DEBUG = DEBUG
  5. ADMINS = (
  6. # ('Your Name', 'your_email@example.com'),
  7. )
  8. MANAGERS = ADMINS
  9. DATABASES = {
  10. 'default': {
  11. 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
  12. 'NAME': 'forumappdemo', # Or path to database file if using sqlite3.
  13. 'USER': '', # Not used with sqlite3.
  14. 'PASSWORD': '', # 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. }
  18. }
  19. # Domain URL used for creating full links in forum admin emails
  20. SITE_DOMAIN = 'http://localhost:8080'
  21. NOTIFY_ADMINS = False # if true add topic/post will send a email to admin
  22. FORUM_MAX_ANONYMOUS_POSTS_PER_HOUR = 10 # how many posts may be made by anonymous within an hour from now
  23. FORUM_MAX_USER_POST_PER_HOUR = 10 # how many posts may be made by every logged in user within an hour from now. 0 - no limit
  24. FORUM_USE_RECAPTCHA = False # if true will show recaptha for users with < 5 posts
  25. RECAPTCHA_PUBLIC_KEY = ''
  26. RECAPTCHA_PRIVATE_KEY = ''
  27. LOGIN_URL = '/user/login/'
  28. LOGIN_REDIRECT_URL = '/'
  29. AUTH_PROFILE_MODULE = 'userpanel.profile'
  30. # Local time zone for this installation. Choices can be found here:
  31. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  32. # although not all choices may be available on all operating systems.
  33. # On Unix systems, a value of None will cause Django to use the same
  34. # timezone as the operating system.
  35. # If running in a Windows environment this must be set to the same as your
  36. # system time zone.
  37. TIME_ZONE = 'America/Chicago'
  38. # Language code for this installation. All choices can be found here:
  39. # http://www.i18nguy.com/unicode/language-identifiers.html
  40. LANGUAGE_CODE = 'en-us'
  41. SITE_ID = 1
  42. # If you set this to False, Django will make some optimizations so as not
  43. # to load the internationalization machinery.
  44. USE_I18N = True
  45. # If you set this to False, Django will not format dates, numbers and
  46. # calendars according to the current locale
  47. USE_L10N = True
  48. # Absolute filesystem path to the directory that will hold user-uploaded files.
  49. # Example: "/home/media/media.lawrence.com/media/"
  50. MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'site_media')
  51. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  52. # trailing slash.
  53. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  54. MEDIA_URL = ''
  55. # Absolute path to the directory static files should be collected to.
  56. # Don't put anything in this directory yourself; store your static files
  57. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  58. # Example: "/home/media/media.lawrence.com/static/"
  59. STATIC_ROOT = ''
  60. # URL prefix for static files.
  61. # Example: "http://media.lawrence.com/static/"
  62. STATIC_URL = '/static/'
  63. # URL prefix for admin static files -- CSS, JavaScript and images.
  64. # Make sure to use a trailing slash.
  65. # Examples: "http://foo.com/static/admin/", "/static/admin/".
  66. ADMIN_MEDIA_PREFIX = '/static/admin/'
  67. # Additional locations of static files
  68. STATICFILES_DIRS = (
  69. # Put strings here, like "/home/html/static" or "C:/www/django/static".
  70. # Always use forward slashes, even on Windows.
  71. # Don't forget to use absolute paths, not relative paths.
  72. )
  73. # List of finder classes that know how to find static files in
  74. # various locations.
  75. STATICFILES_FINDERS = (
  76. 'django.contrib.staticfiles.finders.FileSystemFinder',
  77. 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  78. # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
  79. )
  80. # Make this unique, and don't share it with anybody.
  81. SECRET_KEY = 'jkmes^j1iim))y5uj=(okj4qcf_50+a#^!870z)04%e55%o4cr'
  82. # List of callables that know how to import templates from various sources.
  83. TEMPLATE_LOADERS = (
  84. 'django.template.loaders.filesystem.Loader',
  85. 'django.template.loaders.app_directories.Loader',
  86. # 'django.template.loaders.eggs.Loader',
  87. )
  88. MIDDLEWARE_CLASSES = (
  89. 'django.middleware.common.CommonMiddleware',
  90. 'django.contrib.sessions.middleware.SessionMiddleware',
  91. 'django.middleware.csrf.CsrfViewMiddleware',
  92. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  93. 'django.contrib.messages.middleware.MessageMiddleware',
  94. 'diamandas.userpanel.userMiddleware.userMiddleware',
  95. )
  96. ROOT_URLCONF = 'urls'
  97. TEMPLATE_DIRS = (
  98. 'diamandas/myghtyboard/templates'
  99. )
  100. INSTALLED_APPS = (
  101. 'django.contrib.auth',
  102. 'django.contrib.contenttypes',
  103. 'django.contrib.sessions',
  104. 'django.contrib.sites',
  105. 'django.contrib.messages',
  106. 'django.contrib.staticfiles',
  107. 'diamandas.recaptchawidget',
  108. 'diamandas.myghtyboard',
  109. 'diamandas.userpanel',
  110. 'django.contrib.admin',
  111. )
  112. # A sample logging configuration. The only tangible logging
  113. # performed by this configuration is to send an email to
  114. # the site admins on every HTTP 500 error.
  115. # See http://docs.djangoproject.com/en/dev/topics/logging for
  116. # more details on how to customize your logging configuration.
  117. LOGGING = {
  118. 'version': 1,
  119. 'disable_existing_loggers': False,
  120. 'handlers': {
  121. 'mail_admins': {
  122. 'level': 'ERROR',
  123. 'class': 'django.utils.log.AdminEmailHandler'
  124. }
  125. },
  126. 'loggers': {
  127. 'django.request': {
  128. 'handlers': ['mail_admins'],
  129. 'level': 'ERROR',
  130. 'propagate': True,
  131. },
  132. }
  133. }