settings.py 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. # Import Misago defaults for overriding
  9. from misago.conf.defaults import *
  10. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  11. import os
  12. BASE_DIR = os.path.dirname(os.path.dirname(__file__))
  13. # Quick-start development settings - unsuitable for production
  14. # See https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/checklist/
  15. # SECURITY WARNING: don't run with debug turned on in production!
  16. DEBUG = True
  17. TEMPLATE_DEBUG = DEBUG
  18. MISAGO_JS_DEBUG = DEBUG
  19. # Hosts allowed to reach your site
  20. ALLOWED_HOSTS = []
  21. # Cross-Origin Resource Sharing policy
  22. CORS_ORIGIN_ALLOW_ALL = DEBUG
  23. CORS_ORIGIN_WHITELIST = ()
  24. # Database
  25. # https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#databases
  26. DATABASES = {
  27. 'default': {
  28. 'ENGINE': 'django.db.backends.sqlite3',
  29. 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  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. # Path used to access static files (CSS, JavaScript, Images)
  43. # https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/
  44. STATIC_URL = '/static/'
  45. # Path used to access uploaded media (Avatars and Profile Backgrounds, ect.)
  46. # This is NOT path used to serve posts attachments.
  47. # https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/
  48. MEDIA_URL = '/media/'
  49. # Automatically setup default paths to media and attachments directories
  50. MISAGO_ATTACHMENTS_ROOT = os.path.join(BASE_DIR, 'attachments')
  51. MISAGO_AVATAR_STORE = os.path.join(BASE_DIR, 'avatar_store')
  52. MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  53. STATIC_ROOT = os.path.join(BASE_DIR, 'static')
  54. # Automatically setup default paths for static and template directories
  55. # You can use those directories to easily customize and add your own
  56. # assets and templates to your site
  57. STATICFILES_DIRS = (
  58. os.path.join(BASE_DIR, 'theme/static'),
  59. ) + STATICFILES_DIRS
  60. TEMPLATE_DIRS = (
  61. os.path.join(BASE_DIR, 'theme/templates'),
  62. ) + TEMPLATE_DIRS
  63. # SECURITY WARNING: keep the secret key used in production secret!
  64. SECRET_KEY = '{{ secret_key }}'
  65. # X-Sendfile support
  66. # X-Sendfile is feature provided by Http servers that allows web apps to
  67. # delegate serving files over to the better performing server instead of
  68. # doing it within app.
  69. # If your server supports X-Sendfile or its variation, enter header name here.
  70. # For example if you are using Nginx with X-accel enabled, set this setting
  71. # to "X-Accel-Redirect".
  72. # Leave this setting empty to Django fallback instead
  73. MISAGO_SENDFILE_HEADER = ''
  74. # Allows you to use location feature of your Http server
  75. # For example, if you have internal location /mymisago/avatar_cache/
  76. # that points at /home/myweb/misagoforum/avatar_cache/, set this setting
  77. # to "mymisago".
  78. MISAGO_SENDFILE_LOCATIONS_PATH = ''
  79. # Application definition
  80. # Don't edit those settings unless you know what you are doing
  81. ROOT_URLCONF = '{{ project_name }}.urls'
  82. WSGI_APPLICATION = '{{ project_name }}.wsgi.application'