Created
April 9, 2015 16:56
-
-
Save alxpck/fb34bf9e0a21bf2288cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base/theme.html" %} | |
{% load widget_tweaks %} | |
{% block main_content %} | |
<div class="header-buffer"> | |
</div> | |
<section id="services"> | |
<div class="container"> | |
<div class="row"> | |
{% if form %} | |
<div class="col-md-12"> | |
<form action="" method="post" enctype="multipart/form-data">{% csrf_token %}{{ form.media }} | |
{% for field in form %} | |
<div class="form-group warning"> | |
<label for="exampleInputFile">{{ field.label }}</label> | |
{{ field|add_class:"form-control"}} | |
{% if field.help_text %}<p class="help-block">{{ field.help_text }}</p>{% endif %} | |
</div> | |
{% if field.errors %} | |
{% for error in field.errors %} | |
<div class="alert alert-danger" id="error_{{ field.name }}">{{ error|escape }}</div> | |
{% endfor %} | |
{% endif %} | |
{% endfor %} | |
<input type="submit" class="btn btn-success" role="button" value="{{ verb|default:"Submit" }}" /> | |
</form> | |
</div> | |
{% endif %} | |
</div> | |
</div> | |
</section> | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From One Month Python Course
Teacher: https://github.com/neuman
This is custom Django code that will work for any form.