settings.py 3.4 KB

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