From b83ab0fc87c33325e8e67cadf9569ed9d96b1778 Mon Sep 17 00:00:00 2001 From: Yahialabeeb Date: Wed, 29 Dec 2021 21:53:15 +0200 Subject: [PATCH] add jwt --- lifeshare/urls.py | 3 ++- poetry.lock | 44 +++++++++++++++++++++++++++++++++++++++++++- pyproject.toml | 1 + 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/lifeshare/urls.py b/lifeshare/urls.py index f180867..0cad06a 100644 --- a/lifeshare/urls.py +++ b/lifeshare/urls.py @@ -14,7 +14,8 @@ 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin -from django.urls import path +from django.urls import path, include +from rest_framework_simplejwt import views as jwt_views urlpatterns = [ path('admin/', admin.site.urls), diff --git a/poetry.lock b/poetry.lock index b0b3d63..0313745 100644 --- a/poetry.lock +++ b/poetry.lock @@ -62,6 +62,26 @@ python-versions = ">=3.6" django = ">=2.2" pytz = "*" +[[package]] +name = "djangorestframework-simplejwt" +version = "5.0.0" +description = "A minimal JSON Web Token authentication plugin for Django REST Framework" +category = "main" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +django = "*" +djangorestframework = "*" +pyjwt = ">=2,<3" + +[package.extras] +dev = ["pytest-watch", "wheel", "twine", "ipython", "cryptography", "pytest-cov", "pytest-django", "pytest-xdist", "pytest", "tox", "flake8", "pep8", "isort", "Sphinx (>=1.6.5,<2)", "sphinx-rtd-theme (>=0.1.9)", "python-jose (==3.0.0)"] +doc = ["Sphinx (>=1.6.5,<2)", "sphinx-rtd-theme (>=0.1.9)"] +lint = ["flake8", "pep8", "isort"] +python-jose = ["python-jose (==3.0.0)"] +test = ["cryptography", "pytest-cov", "pytest-django", "pytest-xdist", "pytest", "tox"] + [[package]] name = "gunicorn" version = "20.1.0" @@ -84,6 +104,20 @@ category = "main" optional = false python-versions = ">=3.6" +[[package]] +name = "pyjwt" +version = "2.3.0" +description = "JSON Web Token implementation in Python" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.extras] +crypto = ["cryptography (>=3.3.1)"] +dev = ["sphinx", "sphinx-rtd-theme", "zope.interface", "cryptography (>=3.3.1)", "pytest (>=6.0.0,<7.0.0)", "coverage[toml] (==5.0.4)", "mypy", "pre-commit"] +docs = ["sphinx", "sphinx-rtd-theme", "zope.interface"] +tests = ["pytest (>=6.0.0,<7.0.0)", "coverage[toml] (==5.0.4)"] + [[package]] name = "pytz" version = "2021.3" @@ -122,7 +156,7 @@ brotli = ["brotli"] [metadata] lock-version = "1.1" python-versions = "^3.9" -content-hash = "67118044f3f5f067c6f13623ee1ee4503a79c56bb34fbccea0b3498840fb7e1f" +content-hash = "b6f7c129a9ef84b2d03d519a01b3038b6988d4f1fb30813cc908f472fca2a683" [metadata.files] asgiref = [ @@ -145,6 +179,10 @@ djangorestframework = [ {file = "djangorestframework-3.13.1-py3-none-any.whl", hash = "sha256:24c4bf58ed7e85d1fe4ba250ab2da926d263cd57d64b03e8dcef0ac683f8b1aa"}, {file = "djangorestframework-3.13.1.tar.gz", hash = "sha256:0c33407ce23acc68eca2a6e46424b008c9c02eceb8cf18581921d0092bc1f2ee"}, ] +djangorestframework-simplejwt = [ + {file = "djangorestframework_simplejwt-5.0.0-py3-none-any.whl", hash = "sha256:ddcbeef51155d1e71410dde44b581c7e04cfb74776f5337661ac3ef4c0c367e6"}, + {file = "djangorestframework_simplejwt-5.0.0.tar.gz", hash = "sha256:30b10e7732395c44d21980f773214d2b9bdeadf2a6c6809cd1a7c9abe272873c"}, +] gunicorn = [ {file = "gunicorn-20.1.0-py3-none-any.whl", hash = "sha256:9dcc4547dbb1cb284accfb15ab5667a0e5d1881cc443e0677b4882a4067a807e"}, {file = "gunicorn-20.1.0.tar.gz", hash = "sha256:e0a968b5ba15f8a328fdfd7ab1fcb5af4470c28aaf7e55df02a99bc13138e6e8"}, @@ -207,6 +245,10 @@ psycopg2-binary = [ {file = "psycopg2_binary-2.9.3-cp39-cp39-win32.whl", hash = "sha256:46f0e0a6b5fa5851bbd9ab1bc805eef362d3a230fbdfbc209f4a236d0a7a990d"}, {file = "psycopg2_binary-2.9.3-cp39-cp39-win_amd64.whl", hash = "sha256:accfe7e982411da3178ec690baaceaad3c278652998b2c45828aaac66cd8285f"}, ] +pyjwt = [ + {file = "PyJWT-2.3.0-py3-none-any.whl", hash = "sha256:e0c4bb8d9f0af0c7f5b1ec4c5036309617d03d56932877f2f7a0beeb5318322f"}, + {file = "PyJWT-2.3.0.tar.gz", hash = "sha256:b888b4d56f06f6dcd777210c334e69c737be74755d3e5e9ee3fe67dc18a0ee41"}, +] pytz = [ {file = "pytz-2021.3-py2.py3-none-any.whl", hash = "sha256:3672058bc3453457b622aab7a1c3bfd5ab0bdae451512f6cf25f64ed37f5b87c"}, {file = "pytz-2021.3.tar.gz", hash = "sha256:acad2d8b20a1af07d4e4c9d2e9285c5ed9104354062f275f3fcd88dcef4f1326"}, diff --git a/pyproject.toml b/pyproject.toml index 7142812..d5c6cc5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ psycopg2-binary = "^2.9.3" gunicorn = "^20.1.0" whitenoise = "^5.3.0" django-cors-headers = "^3.10.1" +djangorestframework-simplejwt = "^5.0.0" [tool.poetry.dev-dependencies]