From fe06053abe2859e5a5c4887590c3546f71b6d332 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 22 Mar 2020 06:38:54 -0500 Subject: [PATCH] Adds JWT example to Readme --- README.md | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 3ec4ef7..a106d5e 100644 --- a/README.md +++ b/README.md @@ -18,20 +18,35 @@ Install package Add `dj_rest_auth` app to INSTALLED_APPS in your django settings.py: - INSTALLED_APPS = ( - ..., - 'rest_framework', - 'rest_framework.authtoken', - ..., - 'dj_rest_auth' - ) +```python +INSTALLED_APPS = ( + ..., + 'rest_framework', + 'rest_framework.authtoken', + ..., + 'dj_rest_auth' +) +``` Add URL patterns +```python +urlpatterns = [ + url(r'^dj-rest-auth/', include('dj_rest_auth.urls')) +] +``` + +(Optional) + +Use Http-Only cookies + +```python +REST_USE_JWT = True +JWT_AUTH_COOKIE = 'jwt-auth' +``` + + - urlpatterns = [ - url(r'^dj-rest-auth/', include('dj_rest_auth.urls')) - ] ### Documentation