Доброго времени суток!
Корректно ли использовать конструкцию:
return HttpResponseRedirect(request.META['HTTP_REFERER'])
например, в случае авторизации, для возврата на страницу, с которой был произведён запрос.
Пользователь находится в /sample/foo/.
Отправка запроса с формы, размещённой в /sample/ на /auth/ (views: def auth).
Возврат в /sample/foo/.
В шаблонах для отображения информации использую констркции:
{% if request.user.is_authenticated %}{% endif %}
Насколько это правильный подход? Т.е. в этом случае нужно передавать данные из request. А как быть, если используется:
class PostListView(ListView):
"""
Представление в виде списка
"""
model = Post
Надеюсь на вашу помощь, спасибо!