D
D
dustik2014-06-30 12:04:48
Django
dustik, 2014-06-30 12:04:48

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:
3e0cccf8ad9e47c0a8bfe4d240dc4a05.PNG
If you follow the link to the page with my application, you can see that the user is allegedly not authorized:
2d0450941c294d29bef0fb9b347b7b44.PNG
If you click on the login, then a message appears that the user is still authorized:
5f7311097f494659b5064419562340a6.PNG
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>

Tell me, please, in which direction to dig in my application? Is CSRF to blame or do I need to look somewhere else for the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question