2
0

django_settings.rst 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. Wagtail CRX Django Settings
  2. ===========================
  3. Default settings are loaded from ``coderedcms/settings.py``. Available settings
  4. for Wagtail CRX:
  5. CRX_BANNER
  6. ----------
  7. If you define a value for this ``CRX_BANNER``, CodeRedCMS will show this text in
  8. a banner on both the front end and in the CMS of your site. This is useful for
  9. flagging non-production environments like staging. For example::
  10. CRX_BANNER = "Staging Environment. Production is over here: <a href='https://example.com'>Example link</a>."
  11. You can include basic HTML code, such as a link, in the banner.
  12. The banner defaults to yellow background and black text. If you want to
  13. customize the color, you can specify any HTML color name or code. For example::
  14. CRX_BANNER_BACKGROUND = '#FFFFE0' # light yellow background
  15. CRX_BANNER_TEXT_COLOR = '#000' # black text color
  16. For greater customization, you can fully override the banner's HTML template:
  17. ``coderedcms/includes/crx_banner.html``.
  18. CRX_BANNER_BACKGROUND
  19. ---------------------
  20. String of a valid CSS color code to change the background of the banner.
  21. CRX_BANNER_TEXT_COLOR
  22. ---------------------
  23. String of a valid CSS color code to change the text color of the banner.
  24. CRX_DISABLE_ANALYTICS
  25. ---------------------
  26. If set to ``True``, the ``AnalyticsSettings`` model ( "Tracking" in Wagtail Admin) will not be registered. All tracking and analytics features will be disabled. Note that all buttons and links throughout CRX have "Advanced Settings" to customize the tracking behavior --- if disabled these will do nothing. Defaults to ``False``.
  27. CRX_DISABLE_LAYOUT
  28. ------------------
  29. If set to ``True``, the ``LayoutSettings`` model ( "CRX Settings" in Wagtail Admin) will not be registered. Many features such as the ability to set a logo, favion, Google Maps keys, etc. will not be available.
  30. If you're looking to customize the navbar and footer, it is NOT recommended to disable this, but instead use the ``CRX_DISABLE_NAVBAR`` and ``CRX_DISABLE_FOOTER`` settings. This way the logo and various other features remain customizable by the user. The Layout Settings, and the logo in particular, are used **extensively** throughout CRX and therefore may cause unexpected breakage if disabled. Defaults to ``False``.
  31. CRX_DISABLE_NAVBAR
  32. ------------------
  33. If set to ``True``, the built-in ``Navbar`` model and related settings will be hidden from the Wagtail Admin.
  34. This is recommended for most sites that want to build their own more advanced navbar.
  35. CRX_DISABLE_FOOTER
  36. ------------------
  37. If set to ``True``, the built-in ``Footer`` model and related settings will be hidden from the Wagtail Admin.
  38. This is recommended for most sites that want to build their own more advanced footer.
  39. CRX_FRONTEND_*
  40. --------------
  41. Various frontend settings to specify defaults and choices used in the wagtail
  42. admin related to rendering blocks, pages, and templates. By default, all
  43. CRX_FRONTEND_* settings are designed to work with Bootstrap 5 CSS framework, but
  44. these can be customized if using a different CSS framework or theme variant.
  45. `Available settings are defined here <https://github.com/coderedcorp/coderedcms/blob/main/coderedcms/settings.py>`.
  46. CRX_PROTECTED_MEDIA_ROOT
  47. ------------------------
  48. The directory where files from File Upload fields on Form Pages are saved. These
  49. files are served through Django using ``CRX_PROTECTED_MEDIA_URL`` and require
  50. login to access. Defaults to ``protected/`` in your project directory.
  51. CRX_PROTECTED_MEDIA_UPLOAD_WHITELIST
  52. ------------------------------------
  53. The allowed filetypes for media upload in the form of a list of file type
  54. extensions. Default is blank. For example, to only allow documents and images,
  55. set to: ``['.pdf', '.doc', '.docx', '.txt', '.rtf', '.jpg', '.jpeg', '.png',
  56. '.gif']``
  57. CRX_PROTECTED_MEDIA_UPLOAD_BLACKLIST
  58. ------------------------------------
  59. The disallowed filetypes for media upload in the form of a list of file type
  60. extensions. Defaults to ``['.sh', '.exe', '.bat', '.ps1', '.app', '.jar', '.py',
  61. '.php', '.pl', '.rb']``
  62. CRX_PROTECTED_MEDIA_URL
  63. -----------------------
  64. The URL for protected media files from form file uploads. Defaults to
  65. ``'/protected/'``