settings.py 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. ATTACHMENTS_ROOT = os.path.join(BASE_DIR, 'attachments')
  46. AVATAR_CACHE = os.path.join(BASE_DIR, 'avatar_cache')
  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. # Application definition
  61. # Don't edit those settings unless you know what you are doing
  62. ROOT_URLCONF = '{{ project_name }}.urls'
  63. WSGI_APPLICATION = '{{ project_name }}.wsgi.application'