Skip to content

Commit

Permalink
fix format of document
Browse files Browse the repository at this point in the history
  • Loading branch information
Jianxuan-Li authored and apragacz committed Jul 25, 2023
1 parent b7e07ab commit 00d0db7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions rest_registration/settings_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,18 @@ def __new__(
help=dedent("""\
When set to ``True``, the login view will returns the token.
To make sure that the token can be returned, ``rest_framework.authtoken`` must be added to the ``INSTALLED_APPS`` in your settings.
To make sure that the token can be returned, ``rest_framework.authtoken``
must be added to the ``INSTALLED_APPS`` in your settings.
After added ``rest_framework.authtoken`` to the ``INSTALLED_APPS``, you need to run ``python manage.py migrate`` to apply changes.
After added ``rest_framework.authtoken`` to the ``INSTALLED_APPS``,
you need to run ``python manage.py migrate`` to apply changes.
To use the token authentication, you have two options:
1. add ``rest_framework.authtoken.authentication.TokenAuthentication`` to the ``DEFAULT_AUTHENTICATION_CLASSES`` in your settings.
2. set ``authentication_classes = [TokenAuthentication]`` in your view.
add ``rest_framework.authtoken.authentication.TokenAuthentication`` to
the ``DEFAULT_AUTHENTICATION_CLASSES`` in your settings.
or set ``authentication_classes = [TokenAuthentication]`` in your view.
example 1:
Expand Down Expand Up @@ -294,7 +297,8 @@ class SomeAwesomeView(APIView):
"token": "18eb5c64d21fcc6219facdcd05016d277f92cd90"
}
When you send a request to the protected view, you need to add the token to the request header:
When you send a request to the protected view,
you need to add the token to the request header:
``Authorization: Token ${YourToken}``
""")
Expand Down

0 comments on commit 00d0db7

Please sign in to comment.