
Features
- Strong python/html code separation
- Easy redefinition of particular field rendering
- Complex form layout support
Installation
django-material tested with Python 2.7/3.3, django 1.6/1.7
$ pip install django-material
And add it into INSTALLED_APPS settings
INSTALLED_APPS = (
'material',
'material.admin',
...
)
NOTE: 'material.admin' must be added before 'django.contrib.admin'
Quick start
Include material javascript and styles into your base template.
{% templatetag openblock %} include 'material/includes/material_css.html' {% templatetag closeblock %}
{% templatetag openblock %} include 'material/includes/material_js.html' {% templatetag closeblock %}
Load the `material_form` template tag library
{% templatetag openblock %} load material_form {% templatetag closeblock %}
And render your form with {% templatetag openblock %} form {% templatetag closeblock %} template tag
<form method="POST">
{% templatetag openblock %} csrf_token {% templatetag closeblock %}
{% templatetag openblock %} form form=form {% templatetag closeblock %}{% templatetag openblock %} endform {% templatetag closeblock %}
<button type="submit" name="_submit" class="btn">Submit</button>
</form>