Commit f522953a authored by Ilham Maulana's avatar Ilham Maulana 💻

fix: shift to not use drf

parent 9797a30f
...@@ -11,7 +11,6 @@ https://docs.djangoproject.com/en/5.0/ref/settings/ ...@@ -11,7 +11,6 @@ https://docs.djangoproject.com/en/5.0/ref/settings/
""" """
from pathlib import Path from pathlib import Path
from django.utils.timezone import timedelta
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = Path(__file__).resolve().parent.parent
...@@ -43,34 +42,10 @@ INSTALLED_APPS = [ ...@@ -43,34 +42,10 @@ INSTALLED_APPS = [
"book.apps.BookConfig", "book.apps.BookConfig",
"loans.apps.LoansConfig", "loans.apps.LoansConfig",
"dashboard.apps.DashboardConfig", "dashboard.apps.DashboardConfig",
# 3rd party
"rest_framework",
"rest_framework.authtoken",
"rest_framework_simplejwt",
"django_filters",
] ]
# 3rd party config # 3rd party config
# DJANGO REST FRAMEWORK CONFIG
REST_FRAMEWORK = {
"DEFAULT_AUTHENTICATION_CLASSES": [
"rest_framework.authentication.TokenAuthentication",
],
"DEFAULT_FILTER_BACKENDS": ["django_filters.rest_framework.DjangoFilterBackend"],
"DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination",
"PAGE_SIZE": 10,
}
SIMPLE_JWT = {
"ACCESS_TOKEN_LIFETIME": timedelta(minutes=60),
"SLIDING_TOKEN_REFRESH_LIFETIME": timedelta(days=1),
"SLIDING_TOKEN_LIFETIME": timedelta(days=30),
"SLIDING_TOKEN_REFRESH_LIFETIME_LATE_USER": timedelta(days=1),
"SLIDING_TOKEN_LIFETIME_LATE_USER": timedelta(days=30),
}
# end 3rd party config # end 3rd party config
MIDDLEWARE = [ MIDDLEWARE = [
......
...@@ -53,8 +53,6 @@ urlpatterns = [ ...@@ -53,8 +53,6 @@ urlpatterns = [
), ),
# api # api
path("api/v1/", include("api.urls"), name="API_V1"), path("api/v1/", include("api.urls"), name="API_V1"),
# 3rd party
path("api-auth/", include("rest_framework.urls"), name="api_auth"),
] ]
if settings.DEBUG: if settings.DEBUG:
......
asgiref==3.8.1 asgiref==3.8.1
Django==5.0.7 Django==5.0.7
django-filter==24.2
djangorestframework==3.15.2
djangorestframework-simplejwt==5.3.1
Markdown==3.6
mysqlclient==2.2.4 mysqlclient==2.2.4
pillow==10.4.0 pillow==10.4.0
PyJWT==2.8.0 PyJWT==2.8.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment