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,20 +18,35 @@ Install package
Add `dj_rest_auth` app to INSTALLED_APPS in your django settings.py:
INSTALLED_APPS = (
```python
INSTALLED_APPS = (
...,
'rest_framework',
'rest_framework.authtoken',
...,
'dj_rest_auth'
)
)
```
Add URL patterns
urlpatterns = [
```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'
```
### Documentation