2👍
✅
I think that the error you are getting is very definitive. build_absolute_uri
is an instance method so should be called by an HttpRequest
instance.
>>> from django.http import HttpRequest
>>> request = HttpRequest()
>>> location = reverse("admin:appname_question_change", args=(new_question.pk,))
>>> url = request.build_absolute_uri(location)
Source:stackexchange.com