django_settings.rst 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. CodeRed CMS Django Settings
  2. ===========================
  3. Default settings are loaded from ``coderedcms/settings.py``. Available settings for CodeRed CMS:
  4. CODERED_PROTECTED_MEDIA_ROOT
  5. ----------------------------
  6. The directory where files from File Upload fields on Form Pages are saved. These files are
  7. served through Django using ``CODERED_PROTECTED_MEDIA_URL`` and require login to access.
  8. Defaults to ``protected/`` in your project directory.
  9. CODERED_PROTECTED_MEDIA_URL
  10. ---------------------------
  11. The URL for protected media files from form file uploads. Defaults to ``'/protected/'``
  12. CODERED_PROTECTED_MEDIA_UPLOAD_WHITELIST
  13. ----------------------------------------
  14. The allowed filetypes for media upload in the form of a list of file type extensions.
  15. Default is blank. For example, to only allow documents and images, set to:
  16. ``['.pdf', '.doc', '.docx', '.txt', '.rtf', '.jpg', '.jpeg', '.png', '.gif']``
  17. CODERED_PROTECTED_MEDIA_UPLOAD_BLACKLIST
  18. ----------------------------------------
  19. The disallowed filetypes for media upload in the form of a list of file type extensions.
  20. Defaults to ``['.sh', '.exe', '.bat', '.ps1', '.app', '.jar', '.py', '.php', '.pl', '.rb']``
  21. CODERED_FRONTEND_*
  22. ------------------
  23. Various frontend settings to specify defaults and choices used in the wagtail admin related
  24. to rendering blocks, pages, and templates. By default, all CODERED_FRONTEND_* settings are
  25. designed to work with Bootstrap 4 CSS framework, but these can be customized if using a
  26. different CSS framework or theme variant.
  27. .. warning::
  28. CODERED_FRONTEND_* settings are experimental and are known to cause issues
  29. with migrations. If you do need to use them:
  30. * DO NOT run ``makemigrations`` or ``makemigrations coderedcms``
  31. * ONLY run migrations for specific apps, i.e. ``makemigrations website``
  32. CODERED_BANNER
  33. --------------
  34. If you define a value for this ``CODERED_BANNER``, CodeRedCMS will show this text in a banner
  35. on both the front end and in the CMS of your site. This is useful for flagging non-production
  36. environments like staging. For example::
  37. CODERED_BANNER = "Staging Environment. Production is over here: <a href='https://example.com'>Example link</a>."
  38. You can include basic HTML code, such as a link, in the banner.
  39. CODERED_BANNER_BACKGROUND, CODERED_BANNER_TEXT_COLOR
  40. ----------------------------------------------------
  41. The banner defaults to a background color of red and a text color of white. If you want to
  42. customize this for a particular environment, you can; for example::
  43. CODERED_BANNER_BACKGROUND = '#FFFFE0' # light yellow background
  44. CODERED_BANNER_TEXT_COLOR = '#000' # black text color