Created
January 31, 2012 15:37
-
-
Save ydnax/1711116 to your computer and use it in GitHub Desktop.
basic template for django forms with twitter bootstrap style error messages
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.html" %} | |
{% block title %} | |
{{ title }} | |
{% endblock %} | |
{% block content %} | |
<form action="{{ action }}" method="{% block method %}post{% endblock %}"> | |
{% for field in form %} | |
<div> | |
{% if field.errors %} | |
<div class="alert-message block-message error"> | |
{{ field.label_tag }}: {{ field }} {{ field.errors }} | |
</div> | |
{% else %} | |
{{ field.label_tag }}: {{ field }} | |
{% endif %} | |
</div> | |
{% endfor %} | |
{% csrf_token %} | |
<input type="submit" value="{% block submittext %}Submit{% endblock %}" /> | |
</form> | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment