Skip to content

Commit

Permalink
Update README.rst
Browse files Browse the repository at this point in the history
During the installation of the client, I bumped into 3 small problems in the readme:
- How to install the client in a project. I wasnt aware of the extra index.
- Typo for the restframework settings
- replaced url to path for urls.py
  • Loading branch information
JJFlorian authored Mar 29, 2024
1 parent 4248d0e commit df75371
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ Required settings
The nens-auth-client library exposes one django application: ``nens_auth_client``.
The django built-in apps ``auth``, ``sessions`` and ``contenttypes`` are
also required, but they probably are already there.

To add ``nens_auth_client`` to a django project, add the following to the requirements.txt::

--extra-index-url https://packages.lizard.net

...
nens-auth-client
...

Add these to the ``INSTALLED_APPS`` setting. Make sure your project's app is
listed *before* nens_auth_client::

Expand Down Expand Up @@ -54,7 +63,7 @@ Include the ``nens-auth-client`` urls in your application's urls.py::

urlpatterns = [
...
url(r"^accounts/", include("nens_auth_client.urls", namespace="auth")),
path("accounts/", include("nens_auth_client.urls", namespace="auth")),
...
]

Expand All @@ -73,10 +82,10 @@ Achieve this as follows (in urls.py)::
urlpatterns = [
...
*override_admin_auth(),
url(r"^admin/", admin.site.urls), # is probably already there
path("admin/", admin.site.urls), # is probably already there
...
*override_rest_framework_auth(), # only if you use rest_framework
url(r"^api-auth/", include("rest_framework.urls"), namespace="rest_framework"),
path("api-auth/", include("rest_framework.urls")),
...
]

Expand Down Expand Up @@ -330,7 +339,7 @@ Configure the authentication class::
REST_FRAMEWORK = {
(...)
"DEFAULT_AUTHENTICATION_CLASSES": [
"nens_auth_client.rest_framwork.OAuth2TokenAuthentication",
"nens_auth_client.rest_framework.OAuth2TokenAuthentication",
(...)
]
}
Expand Down

0 comments on commit df75371

Please sign in to comment.