Answer the question
In order to leave comments, you need to log in
Why is the application page (Django) not displaying information that the user is logged in?
Hello.
I ran into a problem:
I am performing authorization on the site being developed.
The template of any flatpages page shows that the user is logged in:
If you follow the link to the page with my application, you can see that the user is allegedly not authorized:
If you click on the login, then a message appears that the user is still authorized:
Both templates and the template the flatpages pages and my app's page template refer to the base template:
The base template has the following code describing authorization information:{% extends "base.html" %}
<div class="form">
{% if user.is_staff %}
<a href="{% url 'admin:index' %}">Панель администрирования</a>
<br>
{% endif %}
{% if not user.is_authenticated %}
<a href="/accounts/login/">Вход</a>
|
<a href="/accounts/register/">Регистрация</a>
{% endif %}
{% if user.is_authenticated %}
<i class="icon-user"></i> <a href="/profiles/edit/">{{ user }}</a>
|
<a href="/accounts/logout/">Выход</a>
{% endif %}
</div>
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