-
Notifications
You must be signed in to change notification settings - Fork 0
obeattie/django-form-rendering
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is a very simple library to help with form rendering in Django. Basically provides a template tag to render any sort of Form instance you can throw at it into a generic template. This assists in keeping your templates maintainable, as all of the form code will be stored in one place, and is easily changeable site-wide should the feeling take you. To use this, you'll need to copy the templatetags directory into one of your applications. If you're not familiar with doing this, you'll find more information at http://docs.djangoproject.com/en/dev/howto/custom-template-tags/ Next, create a generic form template (you'll find an example as quick_form.sample.html) and put it somewhere on your template path. Then tell us where it is by setting the variable QUICK_FORM_TEMPLATE in your settings.py file. If you don't set this, it will default to inc/forms/quick_form.html Once you've done that, you should be good to go. So, go ahead and {% load forms %} at the top of any of your templates where you want to render a form. Then, wherever you want the template code to be inserted, simply do {% form <<form variable name here>> %} -- simple, eh?
About
A simple library to help out with generic form rendering in Django templates
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published