settings.py 3.6 KB

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