Python One-liner: Django Secret Key
I want a valid new Django secret key just often enough to need to know how to generate one quickly and easily but not quite often enough to remember it. I'm pasting the one-line command here, in hopes that I'll remember it or find it faster. (The pipe to pbcopy is Mac-specific; substitute your desktop's equivalent.)
uv run python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key(),end="")' |pbcopy
then paste it into the .env file you’re working on.
Read other posts