settings.py 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. import sys
  2. from misago.settings_base import *
  3. # Allow debug?
  4. DEBUG = True
  5. TEMPLATE_DEBUG = DEBUG
  6. # Board address
  7. BOARD_ADDRESS = 'http://somewhere.com'
  8. # Admin control panel path
  9. # Leave this setting empty or remove it to turn admin panel off.
  10. # Misago always asserts that it has correct admin path and fixes it
  11. # if neccessary. This means "/admincp////" becomes "admincp/" and
  12. # "administration" becomes "administration/"
  13. ADMIN_PATH = 'admincp'
  14. # System admins
  15. ADMINS = ()
  16. # Secret key is used by Django and Misago in hashes generation
  17. # YOU MUST REPLACE IT with random combination of characters
  18. # NEVER EVER SHARE THIS KEY WITH ANYBODY!
  19. # Make it messed up and long, this is example of good secret key:
  20. # yaobeifl1a6hf&3)^uc#^vlu1ud7xp^+*c5zoq*tf)fvs#*o$#
  21. SECRET_KEY = 'secret-key'
  22. # Database connection
  23. DATABASES = {
  24. 'default': {
  25. 'ENGINE': 'django.db.backends.sqlite3', # Can be either 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
  26. 'NAME': 'database.db', # Name of the database or the path to the database file if using sqlite3.
  27. 'USER': '', # Not used with sqlite3.
  28. 'PASSWORD': '', # Not used with sqlite3.
  29. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
  30. 'PORT': '', # Set to empty string for default. Not used with sqlite3.
  31. }
  32. }
  33. # Cache engine
  34. # Misago is EXTREMELY data hungry
  35. # If you don't set any cache, it will BRUTALISE your database and memory
  36. # In production ALWAYS use cache
  37. # For reference read following document:
  38. # https://docs.djangoproject.com/en/dev/topics/cache/
  39. CACHES = {
  40. 'default': {
  41. 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
  42. }
  43. }
  44. # Search engine
  45. # Misago relies on 3rd party search engines to index and search your forum content
  46. # Read following for information on configurating search:
  47. # http://django-haystack.readthedocs.org/en/latest/tutorial.html#modify-your-settings-py
  48. HAYSTACK_CONNECTIONS = {
  49. 'default': {
  50. 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine', # Misago uses Whoosh by default
  51. 'PATH': 'searchindex',
  52. 'INCLUDE_SPELLING': True,
  53. },
  54. }
  55. # Cookies configuration
  56. COOKIES_DOMAIN = '192.168.33.10' # E.g. a cookie domain for "www.mysite.com" or "forum.mysite.com" is ".mysite.com"
  57. COOKIES_PATH = '/'
  58. COOKIES_PREFIX = '' # Allows you to avoid cookies collisions with other applications.
  59. COOKIES_SECURE = False # Set this to true if, AND ONLY IF, you are using SSL on your forum.
  60. # Sessions configuration
  61. SESSION_LIFETIME = 3600 # Number of seconds since last request after which session is marked as expired.
  62. # Local time zone for this installation. Choices can be found here:
  63. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  64. # although not all choices may be available on all operating systems.
  65. # On Unix systems, a value of None will cause Django to use the same
  66. # timezone as the operating system.
  67. # If running in a Windows environment this must be set to the same as your
  68. # system time zone.
  69. TIME_ZONE = 'UTC'
  70. # Language code for this installation. All choices can be found here:
  71. # http://www.i18nguy.com/unicode/language-identifiers.html
  72. LANGUAGE_CODE = 'en_US'
  73. # Absolute filesystem path to the directory that will hold user-uploaded files.
  74. # Always use forward slashes, even on Windows.
  75. # Example: "/home/media/media.lawrence.com/media/"
  76. MEDIA_ROOT = '/vagrant/media/'
  77. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  78. # trailing slash.
  79. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  80. MEDIA_URL = '/media/'
  81. # Absolute path to the directory static files should be collected to.
  82. # Don't put anything in this directory yourself; store your static files
  83. # Always use forward slashes, even on Windows.
  84. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  85. # Example: "/home/media/media.lawrence.com/static/"
  86. STATIC_ROOT = ''
  87. # URL prefix for static files.
  88. # Example: "http://media.lawrence.com/static/"
  89. STATIC_URL = '/static/'
  90. # Additional locations of static files
  91. STATICFILES_DIRS = (
  92. # Put strings here, like "/home/html/static" or "C:/www/django/static".
  93. # Always use forward slashes, even on Windows.
  94. # Don't forget to use absolute paths, not relative paths.
  95. # Make sure directory containing avatars is located under first directory on list
  96. '/vagrant/static/',
  97. )
  98. # E-mail host
  99. EMAIL_HOST = ''
  100. # E-mail port
  101. EMAIL_PORT = 25
  102. # E-mail host user
  103. EMAIL_HOST_USER = ''
  104. # E-mail host password
  105. EMAIL_HOST_PASSWORD = ''
  106. # Use TLS encryption
  107. EMAIL_USE_TLS = False
  108. # E-mail subject prefix added to emails for staff
  109. EMAIL_SUBJECT_PREFIX = '[Misago]'
  110. # Catch-all e-mail address
  111. # If DEBUG_MODE is on, all emails will be sent to this address instead of real recipient.
  112. CATCH_ALL_EMAIL_ADDRESS = ''
  113. # Directories with templates
  114. TEMPLATE_DIRS = (
  115. # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
  116. # Always use forward slashes, even on Windows.
  117. # Don't forget to use absolute paths, not relative paths.
  118. '/vagrant/templates'
  119. )
  120. # List of installed themes
  121. INSTALLED_THEMES = (
  122. 'cranefly', # Default style always first
  123. 'admin', # Admin theme always last
  124. )
  125. # Enable mobile subdomain for mobile stuff
  126. MOBILE_SUBDOMAIN = ''
  127. # Templates used by mobile version
  128. MOBILE_TEMPLATES = ''
  129. # Name of root urls configuration
  130. ROOT_URLCONF = 'deployment.urls'
  131. # Python dotted path to the WSGI application used by Django's runserver.
  132. WSGI_APPLICATION = 'deployment.wsgi.application'
  133. # Empty secret key if its known
  134. if SECRET_KEY == 'yaobeifl1a6hf&3)^uc#^vlu1ud7xp^+*c5zoq*tf)fvs#*o$#':
  135. SECRET_KEY = ''
  136. # Override config if we are in tests
  137. if 'test' in sys.argv:
  138. if not SECRET_KEY:
  139. SECRET_KEY = 'SECRET4TESTS'
  140. DATABASES['default'] = {'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'db4testing'}
  141. CACHES['default'] = {'BACKEND': 'django.core.cache.backends.dummy.DummyCache'}
  142. SKIP_SOUTH_TESTS = True
  143. MEDIA_URL = "http://media.domain.com/"
  144. HAYSTACK_CONNECTIONS = {'default': {'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',},}