File: generate_password.rst

package info (click to toggle)
python-django-extensions 4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,820 kB
  • sloc: python: 18,601; javascript: 7,354; makefile: 108; xml: 17
file content (26 lines) | stat: -rw-r--r-- 810 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
generate_password
=================

:synopsis: Generates a new password that can be used for a user password.

Introduction
-------------

Generate password is a handy command to generate a new password which can be used for a user password.
This uses Python's secret module `Recipes and best practices`_ to generate a password.

There are two options.

You can specify the length of password with the option ``--length``. If you don't specify ``--length``, a default value of 16 is applied.
Using ``--complex`` will add punctuation to the aphabet of characters which the password will be generated from.


Usage
-----

Run ::

    $ python manage.py generate_password [--length=<length>] [--complex]


.. _Recipes and best practices: https://docs.python.org/3/library/secrets.html#recipes-and-best-practices