settings.py 3.3 KB

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