I am working on a Django project and I am relatively new to the Django framework. After running the application using python3 manage.py runserver
I am getting an error like django.template.exceptions.TemplateSyntaxError: Could not parse the remainder: '['role']' from 'session['role']'
.
This is the particular html file to which the error is pointing.
base.html
{% block body %}
<body>
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0">
<a class="navbar-brand col-sm-3 col-md-2 mr-0" href="#"><img src="{% static 'img/logo.png' %} "id="icon" alt="User Icon" width="30" > {{ application.name }}</a>
{% if session['role'] == "manager" %}
# rest of code
How do I get this done with? please help
question from:
https://stackoverflow.com/questions/65843481/django-template-syntax-error-could-not-pass-the-remainder 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…