-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpos_integration.patch
More file actions
65 lines (62 loc) · 1.83 KB
/
Copy pathpos_integration.patch
File metadata and controls
65 lines (62 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
diff --git a/core/settings/base.py b/core/settings/base.py
index 732557d..d63de2c 100644
--- a/core/settings/base.py
+++ b/core/settings/base.py
@@ -31,7 +31,8 @@ INSTALLED_APPS = [
# custom
"app",
"event",
- "news"
+ "news",
+ "pos",
]
MIDDLEWARE = [
@@ -108,6 +109,9 @@ MEDIA_ROOT = BASE_DIR / "media"
REST_FRAMEWORK = {
"DEFAULT_AUTHENTICATION_CLASSES": [
"rest_framework.authentication.SessionAuthentication",
+ # Added for the pos app — additive, existing session-authenticated
+ # views (app, event, news) are unaffected.
+ "rest_framework_simplejwt.authentication.JWTAuthentication",
],
"DEFAULT_THROTTLE_CLASSES": [
"rest_framework.throttling.AnonRateThrottle",
@@ -119,6 +123,14 @@ REST_FRAMEWORK = {
},
}
+from datetime import timedelta # noqa: E402
+
+SIMPLE_JWT = {
+ "ACCESS_TOKEN_LIFETIME": timedelta(hours=1),
+ "REFRESH_TOKEN_LIFETIME": timedelta(days=14),
+ "ROTATE_REFRESH_TOKENS": True,
+}
+
HS_CODE_SEARCH_THRESHOLD = config(
"HS_CODE_SEARCH_THRESHOLD",
default=0.1,
diff --git a/core/urls.py b/core/urls.py
index 6d09185..c120ed5 100644
--- a/core/urls.py
+++ b/core/urls.py
@@ -8,7 +8,8 @@ urlpatterns = [
path("admin/", admin.site.urls),
path("api/v1/", include("app.urls")),
path("api/v1/events/", include("event.urls")),
- path("api/v1/news/", include("news.urls"))
+ path("api/v1/news/", include("news.urls")),
+ path("api/v1/pos/", include("pos.urls")),
]
if settings.DEBUG:
diff --git a/requirements.txt b/requirements.txt
index 87368a8..9c77e09 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -4,6 +4,7 @@ dj-database-url==3.1.2
Django==6.0.5
django-cors-headers==4.9.0
djangorestframework==3.17.1
+djangorestframework-simplejwt==5.5.1
gunicorn==26.0.0
inflection==0.5.1
jsonschema==4.26.0