title: How to add default values in a form using flask?
body: <p>I am trying to add the name of the current user as default into the database after the user submits a form. Currently, I am passing the value to an input value and users can delete it not linking the post to its account/user.</p>
  
  <pre><code> {% if session['email'] != None %}
              &lt;!--seller name--&gt;
              &lt;input type="text" id="seller" name="seller" class="form-control mb-4" placeholder="Seller Name" value="{{session['name']}}"&gt; 
              {% endif %}
  </code></pre>
  
  <pre><code>@app.route('/insert_product', methods=['POST'])
  def insert_product():
      products=mongo.db.products
      if request.method == 'POST':
          products.insert_one(request.form.to_dict())
      return redirect(url_for('user'))
  </code></pre>
  
  <p>What I want is simply that users don't need to put their name, rather their name based on their session be added by default into the form as <code>'seller':session['name']</code>.</p>