Skip to content

Commit

Permalink
add docs about creating the DB table
Browse files Browse the repository at this point in the history
  • Loading branch information
dantownsend committed Sep 9, 2024
1 parent 574c169 commit 715ae20
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/source/mfa/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,27 @@ To generate the encryption key in the above example:
.. note::
Piccolo Admin currently allows you to use a single ``MFAProvider``, but
this might change in the future.

Install dependencies
--------------------

For the above example, you need to install some extra dependencies:

.. code-block:: bash
pip install piccolo_api[authenticator,pynacl]
Create database table
---------------------

You need to create the database table for storing the MFA secrets, either by:

* Adding ``"piccolo_api.mfa.authenticator.piccolo_app"`` to your ``AppRegistry``
in ``piccolo_conf.py``, then running the migrations using
``piccolo migrations forwards all``.
* Manually creating the table.

.. code-block:: pycon
>>> from piccolo_api.mfa.authenticator.tables import AuthenticatorSecret
>>> AuthenticatorSecret.create_table().run_sync()

0 comments on commit 715ae20

Please sign in to comment.