settings.py 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. """
  2. Misago settings for {{ project_name }} project.
  3. For more information on this file, see
  4. https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
  5. For the full list of settings and their values, see
  6. https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/
  7. """
  8. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  9. import os
  10. from misago.conf.defaults import *
  11. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  12. # Quick-start development settings - unsuitable for production
  13. # See https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/checklist/
  14. # SECURITY WARNING: don't run with debug turned on in production!
  15. DEBUG = True
  16. # Hosts allowed to POST to your site
  17. # If you are unsure, just enter here your host name, eg. 'mysite.com'
  18. ALLOWED_HOSTS = []
  19. # Database
  20. # https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#databases
  21. DATABASES = {
  22. 'default': {
  23. # Only PostgreSQL is supported
  24. 'ENGINE': 'django.db.backends.postgresql',
  25. 'NAME': '',
  26. 'USER': '',
  27. 'HOST': 'localhost',
  28. 'PORT': 5432,
  29. }
  30. }
  31. # PostgreSQL text search configuration to use in searches
  32. # Defaults to "simple", for list of installed configurations run "\dF" in "psql"
  33. # Standard configs as of PostgreSQL 9.5: dutch, english, finnish, french,
  34. # german, hungarian, italian, norwegian, portuguese, romanian, russian, simple,
  35. # spanish, swedish, turkish
  36. # Example on adding custom language can be found here: https://github.com/lemonskyjwt/plpstgrssearch
  37. MISAGO_SEARCH_CONFIG = 'simple'
  38. # Cache
  39. # https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#caches
  40. CACHES = {
  41. 'default': {
  42. 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
  43. }
  44. }
  45. # Site language
  46. # https://docs.djangoproject.com/en/{{ docs_version }}/topics/i18n/
  47. LANGUAGE_CODE = 'en-us'
  48. # Fallback Timezone
  49. # Used to format dates on server, that are then
  50. # presented to clients with disabled JS
  51. # Consult http://en.wikipedia.org/wiki/List_of_tz_database_time_zones TZ column
  52. # for valid values
  53. TIME_ZONE = 'UTC'
  54. # Path used to access static files (CSS, JavaScript, Images)
  55. # https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/
  56. STATIC_URL = '/static/'
  57. # Path used to access uploaded media (Avatars and Profile Backgrounds, ect.)
  58. # This is NOT path used to serve posts attachments.
  59. # https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/
  60. MEDIA_URL = '/media/'
  61. # Automatically setup default paths to media and attachments directories
  62. MISAGO_ATTACHMENTS_ROOT = os.path.join(BASE_DIR, 'attachments')
  63. MISAGO_AVATAR_STORE = os.path.join(BASE_DIR, 'avatar_store')
  64. MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  65. STATIC_ROOT = os.path.join(BASE_DIR, 'static')
  66. # Automatically setup default paths for static and template directories
  67. # You can use those directories to easily customize and add your own
  68. # assets and templates to your site
  69. STATICFILES_DIRS = (
  70. os.path.join(BASE_DIR, 'theme', 'static'),
  71. )
  72. TEMPLATES = [
  73. {
  74. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  75. 'DIRS': [
  76. os.path.join(BASE_DIR, 'theme', 'templates'),
  77. ],
  78. 'APP_DIRS': True,
  79. 'OPTIONS': {
  80. 'context_processors': DEFAULT_CONTEXT_PROCESSORS,
  81. },
  82. },
  83. ]
  84. # SECURITY WARNING: keep the secret key used in production secret!
  85. SECRET_KEY = '{{ secret_key }}'
  86. # X-Sendfile support
  87. # X-Sendfile is feature provided by Http servers that allows web apps to
  88. # delegate serving files over to the better performing server instead of
  89. # doing it within app.
  90. # If your server supports X-Sendfile or its variation, enter header name here.
  91. # For example if you are using Nginx with X-accel enabled, set this setting
  92. # to "X-Accel-Redirect".
  93. # Leave this setting empty to Django fallback instead
  94. MISAGO_SENDFILE_HEADER = ''
  95. # Allows you to use location feature of your Http server
  96. # For example, if you have internal location /mymisago/avatar_cache/
  97. # that points at /home/myweb/misagoforum/avatar_cache/, set this setting
  98. # to "mymisago".
  99. MISAGO_SENDFILE_LOCATIONS_PATH = ''
  100. # Application definition
  101. # Don't edit those settings unless you know what you are doing
  102. ROOT_URLCONF = '{{ project_name }}.urls'
  103. WSGI_APPLICATION = '{{ project_name }}.wsgi.application'