Add django-rest-knox

This commit is contained in:
2025-12-16 20:19:55 +05:30
parent 53fc3e5bed
commit bae6bf7a03
4 changed files with 26 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ INSTALLED_APPS = [
"django.contrib.messages",
"django.contrib.staticfiles",
"rest_framework",
"knox",
"notes",
"livereload",
]
@@ -132,6 +133,15 @@ REST_FRAMEWORK = {
"DEFAULT_PERMISSION_CLASSES": [
"rest_framework.permissions.IsAuthenticated",
],
"DEFAULT_AUTHENTICATION_CLASSES": [
"knox.auth.TokenAuthentication",
"rest_framework.authentication.BasicAuthentication",
"rest_framework.authentication.SessionAuthentication",
],
}
REST_KNOX = {
"TOKEN_TTL": None,
}
LOGIN_URL = "login"

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -6,6 +6,7 @@ readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"django>=5.2.8",
"django-rest-knox>=5.0.2",
"djangorestframework>=3.16.1",
]

15
uv.lock generated
View File

@@ -8,6 +8,7 @@ version = "0.1.0"
source = { virtual = "." }
dependencies = [
{ name = "django" },
{ name = "django-rest-knox" },
{ name = "djangorestframework" },
]
@@ -22,6 +23,7 @@ dev = [
[package.metadata]
requires-dist = [
{ name = "django", specifier = ">=5.2.8" },
{ name = "django-rest-knox", specifier = ">=5.0.2" },
{ name = "djangorestframework", specifier = ">=3.16.1" },
]
@@ -114,6 +116,19 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/8c/cd/77566526193cb49e805bd33a6b982ba5a39f3a7f828dd6647a76bf977f3c/django_livereload_server-0.5.1-py2.py3-none-any.whl", hash = "sha256:e03bd65d1679ef1b4a5e22e2a77d11d3cfb0e3d21ae25afba49e280924ba6f58", size = 25920, upload-time = "2023-12-19T23:22:00.494Z" },
]
[[package]]
name = "django-rest-knox"
version = "5.0.2"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "django" },
{ name = "djangorestframework" },
]
sdist = { url = "https://files.pythonhosted.org/packages/ba/7e/6ef520fbfa0cb902fe32c6f921426b1dcfa50cb2471a0ddca31ba770fa72/django_rest_knox-5.0.2.tar.gz", hash = "sha256:f283622bcf5d28a6a0203845c065d06c7432efa54399ae32070c61ac03af2d6f", size = 16292, upload-time = "2024-09-30T21:21:07.606Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/13/29/09468c086fd19f34b00a9698ee9cc1864dfae8c171be140657b965577472/django_rest_knox-5.0.2-py3-none-any.whl", hash = "sha256:694da5d0ad6eb3edbfd7cdc8d69c089fc074e6b0e548e00ff2750bf2fdfadb6f", size = 14960, upload-time = "2024-09-30T21:21:04.896Z" },
]
[[package]]
name = "django-stubs"
version = "5.2.8"