我一直在想一件事,(我是 Django 的新手)如何了解正在发出请求或下订单的用户,而不必要求他们在登录后填写用户名表单已经
我一直在想一件事,(我是Django新手)如何了解发出请求的用户。
my_request_function(
request: HttpRequest,
*args, **kwargs,
) -> HttpResponse:
user = request.user
# some more code to compute the template to render and the context
# the template if necessary
return render( request, my_template, my_context, )