Skip to content

Commit

Permalink
plain utils generate-secret-key
Browse files Browse the repository at this point in the history
  • Loading branch information
davegaeddert committed Sep 26, 2024
1 parent 0997502 commit b0daa5a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions plain/plain/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from plain import preflight
from plain.assets.compile import compile_assets, get_compiled_path
from plain.packages import packages
from plain.utils.crypto import get_random_string

from .formatting import PlainContext
from .packages import EntryPointGroup, InstalledPackagesGroup
Expand Down Expand Up @@ -406,6 +407,18 @@ def setting(setting_name):
click.secho(f'Setting "{setting_name}" not found', fg="red")


@plain_cli.group()
def utils():
pass


@utils.command()
def generate_secret_key():
"""Generate a new secret key"""
new_secret_key = get_random_string(50)
click.echo(new_secret_key)


class AppCLIGroup(click.Group):
"""
Loads app.cli if it exists as `plain app`
Expand Down

0 comments on commit b0daa5a

Please sign in to comment.