Adds JWT example to Readme

This commit is contained in:
Michael 2020-03-22 06:38:54 -05:00
parent 27226223f4
commit fe06053abe

View File

@ -18,6 +18,7 @@ Install package
Add `dj_rest_auth` app to INSTALLED_APPS in your django settings.py: Add `dj_rest_auth` app to INSTALLED_APPS in your django settings.py:
```python
INSTALLED_APPS = ( INSTALLED_APPS = (
..., ...,
'rest_framework', 'rest_framework',
@ -25,13 +26,27 @@ Add `dj_rest_auth` app to INSTALLED_APPS in your django settings.py:
..., ...,
'dj_rest_auth' 'dj_rest_auth'
) )
```
Add URL patterns Add URL patterns
```python
urlpatterns = [ urlpatterns = [
url(r'^dj-rest-auth/', include('dj_rest_auth.urls')) 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'
```
### Documentation ### Documentation