Answer the question
In order to leave comments, you need to log in
Custom decorator in django?
Good day!
Help, how to write a decorator for this view?
def home(request):
context = {
'title': 'Главная'
}
if request.is_ajax():
data = {
"url": "/",
"title": "Главная",
"content": render_to_string("articles/list_ajax.html"),
}
return JsonResponse(data)
return render(request, "articles/feed.html", context)
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