' + 111 | '' + 112 | _("Hide Search Matches") + 113 | "
" 114 | ) 115 | ); 116 | }, 117 | 118 | /** 119 | * helper function to hide the search marks again 120 | */ 121 | hideSearchWords: () => { 122 | document 123 | .querySelectorAll("#searchbox .highlight-link") 124 | .forEach((el) => el.remove()); 125 | document 126 | .querySelectorAll("span.highlighted") 127 | .forEach((el) => el.classList.remove("highlighted")); 128 | localStorage.removeItem("sphinx_highlight_terms") 129 | }, 130 | 131 | initEscapeListener: () => { 132 | // only install a listener if it is really needed 133 | if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; 134 | 135 | document.addEventListener("keydown", (event) => { 136 | // bail for input elements 137 | if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; 138 | // bail with special keys 139 | if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; 140 | if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { 141 | SphinxHighlight.hideSearchWords(); 142 | event.preventDefault(); 143 | } 144 | }); 145 | }, 146 | }; 147 | 148 | _ready(() => { 149 | /* Do not call highlightSearchWords() when we are on the search page. 150 | * It will highlight words from the *previous* search query. 151 | */ 152 | if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); 153 | SphinxHighlight.initEscapeListener(); 154 | }); 155 | -------------------------------------------------------------------------------- /djpro/base.py: -------------------------------------------------------------------------------- 1 | # This file is part of djpro. 2 | # 3 | # Copyright (c) 2024, Franco Gidaszewski
254 | from django.core.management.utils import get_random_secret_key
255 |
256 |
257 |
258 | [docs]
259 | def generate_secret_key():
260 | """Django predefined function to create the Django secret key.
261 | Return a 50 character random string usable as a SECRET_KEY setting value."""
262 | return get_random_secret_key()
263 |
264 | To include the Unfold custom theme for Django Admin Site, adds the --unfold option
262 | to the general djpro project creation command:
djpro project YOUR-PROJECT-NAME --unfold
264 | Note
268 |Change YOUR-PROJECT-NAME to your project name.
269 | Find your unfold configuration in settings_base.