I have a beginner problem… I want to call a request.session.get from an html… this is the code…
{% if request.session.get['sesioncarro']%}
<th > Product</th>
{% endif %}
<th > Product</th>
</tbody>
and the error is
TemplateSyntaxError at /ventasapp/ventas/
Could not parse the remainder: ‘[‘sesioncarro’]’ from ‘request.session.get[‘sesioncarro’]’
| Request Method: | GET |
|---|---|
| Request URL: | http://127.0.0.1:8000/ventasapp/ventas/ |
| Django Version: | 5.1.1 |
| Exception Type: | TemplateSyntaxError |
| Exception Value: | Could not parse the remainder: ‘[‘sesioncarro’]’ from ‘request.session.get[‘sesioncarro’]’ |
| Exception Location: | C:\Users\HP\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\template\base.py, line 706, in init |
| Raised during: | ventasapp.views.ListaDventa |
| Python Executable: | C:\Users\HP\AppData\Local\Programs\Python\Python312\python.exe |
| Python Version: | 3.12.5 |
| Python Path: | ``` |
| [‘C:\Users\HP\Desktop\python\Proyecto\webproyect’, | |
| ‘C:\Users\HP\AppData\Local\Programs\Python\Python312\python312.zip’, | |
| ‘C:\Users\HP\AppData\Local\Programs\Python\Python312\DLLs’, | |
| ‘C:\Users\HP\AppData\Local\Programs\Python\Python312\Lib’, | |
| ‘C:\Users\HP\AppData\Local\Programs\Python\Python312’, | |
| ‘C:\Users\HP\AppData\Local\Programs\Python\Python312\Lib\site-packages’] |