0
Hello I need to get the user who is logged in to the system for when he does an Update or Insert in the database enter his record, currently in the template I can already get the user name with this command
{{ current_user.name }}
However when the user calls a route I would like to take this user to enter in the register of manipulations of the database, today I am using python and Flask in my application, could give me a help ?
Below the View code where I can catch the current user, but I need his data when calling the next route
{% extends "base.html" %}
{% block conteudo %}
{% include 'components/notification.html' %}
<div class="container">
<div class="row">
<div class="col-sm-3">
<span><p>Olá <label name="usuario">{{ current_user.name }}</label>, escolha o arquivo com as informações para começarmos </p></span>
</div>
<div class="col-sm-6">
<form action = "/uploader" method = "POST" enctype = "multipart/form-data">
<input type = "file" name = "file" />
<input type = "submit"/>
</form>
</div>
<div class="col-sm-3">
</div>
</div>
</div>
{% endblock %}
Rodrigo, please put the code you are trying to use on
view/controller
– RFL
Hello, I just updated my post, what I wanted and take the current user and try to pass this information to the Route /Uploader , I put the {{current_user.name}} as parameter but it does not work, in View it works ok , takes the user data that is currently logged in.
– Rodrigo Augusto Martins