settings.py 3.7 KB

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