Integrate Deutsche Post shipping API and models

Added Deutsche Post as a shipping carrier, including new models, admin, serializers, and API client integration. Updated Carrier and SiteConfiguration models to support Deutsche Post, including shipping price and API credentials. Added requirements for the Deutsche Post API client and dependencies.
This commit is contained in:
2026-01-11 16:32:51 +01:00
parent 7ebc83dd8c
commit 2213e115c6
131 changed files with 14686 additions and 5 deletions

View File

@@ -20,12 +20,18 @@ password_reset_token = PasswordResetTokenGenerator()
from rest_framework_simplejwt.authentication import JWTAuthentication
from rest_framework_simplejwt.exceptions import InvalidToken, TokenError
#NEMĚNIT CUSTOM SBÍRANÍ COOKIE TOKENU
#COOKIE + AUTHORIZATION HEADER JWT AUTHENTICATION FOR AXIOS COMPATIBILITY
class CookieJWTAuthentication(JWTAuthentication):
def authenticate(self, request):
# First try Authorization header (standard axios pattern)
header_token = self.get_header(request)
if header_token is not None:
validated_token = self.get_validated_token(header_token)
return self.get_user(validated_token), validated_token
# Fallback to cookie-based authentication
raw_token = request.COOKIES.get('access_token')
if not raw_token:
return None