An open source Django extension that provides Simple JWT Authentication.
Project description
Django-JWT-Extended
쉽고 빠르게 Django로 JWT 인증 기능을 구현해보세요!
Requirements
- Python (3.6, 3.7, 3.8, 3.9, 3.10)
- Django (2.2, 3.0, 3.1, 3.2, 4.0)
Installation
Pip: pip install django-jwt-extended
그 후, INSTALLED_APPS
settings에 django_jwt_extended
를 추가해주세요.
INSTALLED_APPS = [
...
'django_jwt_extended',
]
Get Started
django-jwt-extended는 최대한 쉽고 간단하게 인증 기능을 구현할 수 있도록 만들었어요!
Startup your project
$ pip install django
$ pip install django-jwt-extended
$ django-admin startproject example .
$ python manage.py migrate
$ python manage.py createsuperuser
Edit your views
# views.py
from django.http import JsonResponse
from django_jwt_extended import jwt_required
from django_jwt_extended import create_access_token
from django_jwt_extended import get_jwt_identity
def login(request):
"""Create JWT Token API"""
return JsonResponse({
"access_token": create_access_token(identity="iml"),
})
@jwt_required()
def user(request):
"""JWT Authentication API"""
identity = get_jwt_identity(request) # "iml"
return JsonResponse({'id': identity,})
문서화 진행 중 입니다...😢
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-jwt-extended-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f03334c430a10b998b166bbf48fc2dfe1c2a18d500649b05acd7cf10f2044fc7 |
|
MD5 | ecfd3d51d0577d9b80f490c57fff224f |
|
BLAKE2b-256 | 7c05f486e674b864578c59ac02ec81b9f9553c7cf3026c38d10b64484715dd5c |
Close
Hashes for django_jwt_extended-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df68ecf15b4d325ec70f8270663e4d410bfea5d1914fe89f11dc07be318e3511 |
|
MD5 | 371519c914da004190a688be75657f9e |
|
BLAKE2b-256 | 7ff10c45ee96f7de65cc404598a930c366e9dc1b27a0d39b616988875a826c28 |