Решил путем кэширования страницы на 1 час.
CLI
python manage.py createcachetable cache_table
settings.py
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'cache_table',
}
}
views.pyfrom django.views.decorators.cache import cache_page
@cache_page(60 * 60)
def get_ref_book_partial(request):
if request.user.is_authenticated:
ref_book_code = request.GET.get("ref_book_code")
version = request.GET.get("version")
part_number = request.GET.get("part_number")
settings = zeep.Settings(strict=True)
client = zeep.Client(wsdl=wsdl, settings=settings)
return HttpResponse(
str(
client.service.getRefbookPartial(
user_key, ref_book_code, version, part_number
)
)
)
else:
return redirect("/api-auth/login/", locals())