settings.py 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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_psycopg2',
  25. 'NAME': '',
  26. 'USER': '',
  27. 'HOST': 'localhost',
  28. 'PORT': 5432,
  29. }
  30. }
  31. # Cache
  32. # https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#caches
  33. CACHES = {
  34. 'default': {
  35. 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
  36. }
  37. }
  38. # Site language
  39. # https://docs.djangoproject.com/en/{{ docs_version }}/topics/i18n/
  40. LANGUAGE_CODE = 'en-us'
  41. # Fallback Timezone
  42. # Used to format dates on server, that are then
  43. # presented to clients with disabled JS
  44. # Consult http://en.wikipedia.org/wiki/List_of_tz_database_time_zones TZ column
  45. # for valid values
  46. TIME_ZONE = 'UTC'
  47. # Path used to access static files (CSS, JavaScript, Images)
  48. # https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/
  49. STATIC_URL = '/static/'
  50. # Path used to access uploaded media (Avatars and Profile Backgrounds, ect.)
  51. # This is NOT path used to serve posts attachments.
  52. # https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/
  53. MEDIA_URL = '/media/'
  54. # Automatically setup default paths to media and attachments directories
  55. MISAGO_ATTACHMENTS_ROOT = os.path.join(BASE_DIR, 'attachments')
  56. MISAGO_AVATAR_STORE = os.path.join(BASE_DIR, 'avatar_store')
  57. MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  58. STATIC_ROOT = os.path.join(BASE_DIR, 'static')
  59. # Automatically setup default paths for static and template directories
  60. # You can use those directories to easily customize and add your own
  61. # assets and templates to your site
  62. STATICFILES_DIRS = (
  63. os.path.join(BASE_DIR, 'theme', 'static'),
  64. )
  65. TEMPLATES = [
  66. {
  67. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  68. 'DIRS': [
  69. os.path.join(BASE_DIR, 'theme', 'templates'),
  70. ],
  71. 'APP_DIRS': True,
  72. 'OPTIONS': {
  73. 'context_processors': DEFAULT_CONTEXT_PROCESSORS,
  74. },
  75. },
  76. ]
  77. # SECURITY WARNING: keep the secret key used in production secret!
  78. SECRET_KEY = '{{ secret_key }}'
  79. # X-Sendfile support
  80. # X-Sendfile is feature provided by Http servers that allows web apps to
  81. # delegate serving files over to the better performing server instead of
  82. # doing it within app.
  83. # If your server supports X-Sendfile or its variation, enter header name here.
  84. # For example if you are using Nginx with X-accel enabled, set this setting
  85. # to "X-Accel-Redirect".
  86. # Leave this setting empty to Django fallback instead
  87. MISAGO_SENDFILE_HEADER = ''
  88. # Allows you to use location feature of your Http server
  89. # For example, if you have internal location /mymisago/avatar_cache/
  90. # that points at /home/myweb/misagoforum/avatar_cache/, set this setting
  91. # to "mymisago".
  92. MISAGO_SENDFILE_LOCATIONS_PATH = ''
  93. # Application definition
  94. # Don't edit those settings unless you know what you are doing
  95. ROOT_URLCONF = '{{ project_name }}.urls'
  96. WSGI_APPLICATION = '{{ project_name }}.wsgi.application'