duck.backend.django.views¶
Module containing the default view to handle all Django requests through redirecting them to the appropriate Duck view to produce a response.
Module Contents¶
Functions¶
Django default view to handle requests meant for urlpatterns registered within Duck. |
|
Django default view to handle requests meant for urlpatterns registered within Duck. |
|
Decorator to ensure that the Django request.META gets updated with the Duck request.META before processing the function. |
API¶
- duck.backend.django.views._duck_django_view(request: django.http.request.HttpRequest) django.http.response.HttpResponse¶
Django default view to handle requests meant for urlpatterns registered within Duck.
- Parameters:
request – The Django HTTP request.
- Returns:
The corresponding Django HTTP response.
- Return type:
DjangoHttpResponse
- duck.backend.django.views.duck_django_view(request: django.http.request.HttpRequest) django.http.response.HttpResponse¶
Django default view to handle requests meant for urlpatterns registered within Duck.
- Parameters:
request – The Django HTTP request.
- Returns:
The corresponding Django HTTP response.
- Return type:
DjangoHttpResponse
- duck.backend.django.views.request_meta_update(func: Callable)¶
Decorator to ensure that the Django request.META gets updated with the Duck request.META before processing the function.
Why Do This:
Keeps the Django request.META in sync with the Duck request.META.
Ensures consistency in metadata between the two request objects.
- Parameters:
func – The function to be wrapped.
- Returns:
The wrapped function with synchronized request.META.
- Return type:
Callable