From df753716c84f79b00d2d4174d6e0f77e5321b102 Mon Sep 17 00:00:00 2001 From: Florian Knappers <73856313+JJFlorian@users.noreply.github.com> Date: Fri, 29 Mar 2024 09:29:01 +0100 Subject: [PATCH] Update README.rst 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 --- README.rst | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 0f62dc5..0e25377 100644 --- a/README.rst +++ b/README.rst @@ -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:: @@ -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")), ... ] @@ -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")), ... ] @@ -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", (...) ] }