config_file.rst 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. Config file
  2. ===========
  3. Options available in settings.py:
  4. JET_DEFAULT_THEME
  5. -----------------
  6. Django JET allows you to change default theme. This feature is mainly used for customizing color schemes rather than
  7. making absolutely different themes. This option in fact make Django load different css styles.
  8. Possible built-in themes are:
  9. * default
  10. * green
  11. * light-violet
  12. * light-green
  13. * light-blue
  14. * light-gray
  15. To change theme use parameter:
  16. .. code:: python
  17. JET_DEFAULT_THEME = 'light-gray'
  18. JET_THEMES
  19. ----------
  20. You can allow your users to change admin panel color scheme. This option will add color scheme chooser to the user dropdown menu. Make ``JET_THEMES`` an empty list to disable this feature.
  21. .. code:: python
  22. JET_THEMES = [
  23. {
  24. 'theme': 'default', # theme folder name
  25. 'color': '#47bac1', # color of the theme's button in user menu
  26. 'title': 'Default' # theme title
  27. },
  28. {
  29. 'theme': 'violet',
  30. 'color': '#a464c4',
  31. 'title': 'Violet'
  32. },
  33. {
  34. 'theme': 'green',
  35. 'color': '#44b78b',
  36. 'title': 'Green'
  37. },
  38. {
  39. 'theme': 'light-green',
  40. 'color': '#2faa60',
  41. 'title': 'Light Green'
  42. },
  43. {
  44. 'theme': 'light-violet',
  45. 'color': '#a464c4',
  46. 'title': 'Light Violet'
  47. },
  48. {
  49. 'theme': 'light-blue',
  50. 'color': '#5EADDE',
  51. 'title': 'Light Blue'
  52. },
  53. {
  54. 'theme': 'light-gray',
  55. 'color': '#222',
  56. 'title': 'Light Gray'
  57. }
  58. ]
  59. CUSTOM JET_THEME
  60. ----------------
  61. You are free to add your own color schemes by adding new folder to **/static/jet/css/themes/**.
  62. You can use **/jet/static/jet/css/themes/light-violet/** folder as an example (available in Django JET repository).
  63. _variables.scss contains **all** customizable variables. You'll have to compile all .scss files in theme directory
  64. to start using your own theme.
  65. CUSTOM MENU
  66. -----------
  67. By default JET displays all applications and it models in the side menu in the alphabetical order.
  68. To display applications and models you want or to change their order you can use ``JET_SIDE_MENU_CUSTOM_APPS`` setting.
  69. .. code:: python
  70. JET_SIDE_MENU_CUSTOM_APPS = [
  71. ('core', [ # Each list element is a tuple with application name (app_label) and list of models
  72. 'User',
  73. 'MenuItem',
  74. 'Block',
  75. ]),
  76. ('shops', [
  77. 'Shop',
  78. 'City',
  79. 'MetroStation',
  80. ]),
  81. ('feedback', [
  82. 'Feedback',
  83. ]),
  84. ]
  85. If want to show all application's models use ``__all__`` keyword.
  86. .. code:: python
  87. JET_SIDE_MENU_CUSTOM_APPS = [
  88. ('core', ['__all__']),
  89. ...
  90. ]
  91. .. note::
  92. You can use ``jet_custom_apps_example`` management command to generate example ``JET_SIDE_MENU_CUSTOM_APPS``
  93. setting which includes all your applications and models. You can use it this way:
  94. .. code:: python
  95. python manage.py jet_custom_apps_example
  96. JET_INDEX_DASHBOARD
  97. -------------------
  98. Sets which dashboard class will be used for rendering admin index dashboard. Allows you to create
  99. your own dashboard with custom modules and pre-installed layout.
  100. .. code:: python
  101. JET_INDEX_DASHBOARD = 'jet.dashboard.DefaultIndexDashboard'
  102. JET_APP_INDEX_DASHBOARD
  103. -----------------------
  104. Same as **JET_INDEX_DASHBOARD**, but for application pages
  105. .. code:: python
  106. JET_APP_INDEX_DASHBOARD = 'jet.dashboard.DefaultAppIndexDashboard'