Skip to main content

Django form rendering helpers

Project description

Overview

Rendering forms with Django can be painful and not very rewarding. There are some nice solutions arround like django-floppyforms or django-crispy-forms but you may want something a bit less complex.

Formica design is heavily based on Formulation, a very lightweight, yet powerful, solution based on template blocks. All credits should go to Curtis Maloney for this impressive and simple idea.

A simple example

Say we have a form somewhere and want to render it in a template.

from django import forms
class MyForm(forms.Form):
  email = forms.EmailField(label='Email')
  check = forms.BooleanField(label='I really love spam', required=False)

Rendering the form is as simple as:

{% load formica %}

<form method="post">
  {% form "formica/base_form.html" %}
    {% fields %}
  {% endform %}

  <p><input type="submit" value="save" /></p>
</form>

Pretty cool isn’t it? Read the documentation to learn more.

Sources & license

Formica sources are hosted on Github: https://github.com/olivier-m/formica

Formica is released under the FreeBSD license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

formica-1.2.tar.gz (7.0 kB view details)

Uploaded Source

File details

Details for the file formica-1.2.tar.gz.

File metadata

  • Download URL: formica-1.2.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for formica-1.2.tar.gz
Algorithm Hash digest
SHA256 44a88717f56253a7921894f743eb4997ab3ba9d65b73fab40f351aa97fe49d2d
MD5 e5bb2f9cea0f998af2ec5b256ab15d63
BLAKE2b-256 707ed8b3c970df646dd4299a2fa61c3d00cc3c93b54e0839f08326e00ab6cdf2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page