Changes between Version 4 and Version 5 of Ticket #36782


Ignore:
Timestamp:
Dec 8, 2025, 5:57:19 AM (96 minutes ago)
Author:
Joe Philip
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36782 – Description

    v4 v5  
    2323This command would output a securely generated secret key using Django's existing function:
    2424
    25 ```python
     25{{{
    2626get_random_secret_key()
    27 ```
     27}}}
    2828
    2929**Example Output**
    3030
    31 ```
    32 g6v#s-!98=u&1xp$@1g&3s5)k5a(4l#1$g@)n#hjz9c4
    33 ```
     31`g6v#s-!98=u&1xp$@1g&3s5)k5a(4l#1$g@)n#hjz9c4`
    3432
    3533---
     
    4846A new command under:
    4947
    50 ```
    51 django/core/management/commands/generate_secret_key.py
    52 ```
     48`django/core/management/commands/generate_secret_key.py`
    5349
    5450Example implementation:
    5551
    56 ```python
     52
     53{{{
    5754from django.core.management.base import BaseCommand
    5855from django.core.management.utils import get_random_secret_key
     
    6360    def handle(self, *args, **options):
    6461        self.stdout.write(get_random_secret_key())
    65 ```
     62}}}
    6663
    6764---
     
    8380Example:
    8481
    85 ```python
     82{{{
    8683from django.core.management import call_command
    8784from django.test import SimpleTestCase
     
    9289        self.assertIsInstance(key, str)
    9390        self.assertGreater(len(key), 30)
    94 ```
     91}}}
Back to Top