I need to include data from a list in a Django form as Default

0

I want to display a form in the template already with the variables {{n}} of a list. How to do?

{% if forloop.counter == 3 %}
   {% for n in campos %} 
      {% if forloop.counter == 3 %}
      <div class="form-group{% if field.errors %} has-error{% endif %}">
          <label for="{{ field.auto_id }}" class="col-md-3 control-label">{{ field.labels }}</label>
          <div class="col-md-6">
              {{ field.label_tag }}
              <input type = "text" id="guests"  value = "{{n}}">
          </div>
       </div>
      {% endif %}    
   {% endfor %}      
{% endif %}
    
asked by anonymous 20.01.2018 / 20:28

0 answers