Answer the question
In order to leave comments, you need to log in
Django: How to execute a long running function after returning a response to the user?
Standard view function:
def view(request, id):
article = get_object_or_404(Articles, id=id)
return render(request, 'view.html', {'article': article})
def view(request, id):
article = get_object_or_404(Articles, id=id)
save_stat(request, article.id)
return render(request, 'view.html', {'article': article})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question