Джанго предыдущий URL
# Returns None if user came from another website
request.META.get('HTTP_REFERER')
Attractive Addax
# Returns None if user came from another website
request.META.get('HTTP_REFERER')