Skip to content

library: secure SECRET_KEY generation and tidy IconWithTooltip#1634

Open
davmlaw wants to merge 1 commit into
masterfrom
hardening/library-secret-key-and-icon
Open

library: secure SECRET_KEY generation and tidy IconWithTooltip#1634
davmlaw wants to merge 1 commit into
masterfrom
hardening/library-secret-key-and-icon

Conversation

@davmlaw

@davmlaw davmlaw commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🤖 Written by Claude

Two small, self-contained code-quality improvements in library/:

  • SECRET_KEY generation — use the standard django.core.management.utils.get_random_secret_key() instead of the bespoke random-based generate_key() helper. Only affects fresh deployments where django_secret_key.txt does not yet exist; existing keys are untouched.
  • IconWithTooltip — build the <i> markup with format_html() instead of hand-assembling a SafeString, removing the manual escaping and now-unused imports.

No behaviour change for normal inputs; py_compile clean.

- Generate the Django SECRET_KEY with django.core.management.utils.get_random_secret_key()
  instead of the home-grown random-based generator (only affects fresh deployments where
  django_secret_key.txt does not yet exist)
- Build IconWithTooltip markup with format_html() rather than hand-assembling a SafeString,
  removing now-unused imports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant