Skip to main content

Django-pony-forms helps you to write better html for your Django forms

Project description

Build Status Version

Coverage Status Requirements Status

License

Django pony forms

Django-pony-forms helps you to write better html for your Django forms.

Read the documentation on readthedocs

1: Better form html by default

The form html that Django produces is not very nice or useful. For example, the default output of a Django form is a table.

Just mixin PonyFormMixin to produce better html:

class ExampleForm(PonyFormMixin, forms.Form):
    name = forms.CharField()

This produces the following html:

<div class="form-row row-name">
    <label for="id_name">Name</label>
    <input type="text" id="id_name" name="name" />
</div>

2: Write your own form templates

You can also write your own form templates:

class ExampleForm(PonyFormMixin, forms.Form):
    name = forms.CharField()

    form_template = 'my_form.html'
    row_template = 'my_row.html'

my_form.html:

<div class="my_form">
    {{ hidden_fields }}
    {{ top_errors }}
    {{ rows }}
</div>

Requirements

The package is tested with Django 1.11 - 2.2 and Python 2.7, 3.5-3.7.

Installation

Install the package:

$ pip install django_pony_forms

Add django_pony_forms to your installed apps in settings.py.

INSTALLED_APPS = (
    ..
    'django_pony_forms',
)

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

django_pony_forms-0.7.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distributions

django_pony_forms-0.7.1-py3.6.egg (5.7 kB view details)

Uploaded Source

django_pony_forms-0.7.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file django_pony_forms-0.7.1.tar.gz.

File metadata

  • Download URL: django_pony_forms-0.7.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/2.7.16

File hashes

Hashes for django_pony_forms-0.7.1.tar.gz
Algorithm Hash digest
SHA256 78d2db7c3afdd6190fcf47f639e5a8da90693a5dfd590ecbc00484589a1cf63d
MD5 5c48254f52ac61641d94df5b38c3ab66
BLAKE2b-256 8f7fc3dd5d6ad17d5c665797dd316212c161e71391e9d12cf0619b5b13d1189a

See more details on using hashes here.

File details

Details for the file django_pony_forms-0.7.1-py3.6.egg.

File metadata

  • Download URL: django_pony_forms-0.7.1-py3.6.egg
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/2.7.16

File hashes

Hashes for django_pony_forms-0.7.1-py3.6.egg
Algorithm Hash digest
SHA256 2eb7c48a65ce9dc306df3204c7821f757f238838f259794d8d95a86615903303
MD5 6002aff57948391c70e49f08377df314
BLAKE2b-256 de63260c0da238c8315eb4e66d756fb8700c0f08ee35eea73fdda5a359ad8405

See more details on using hashes here.

File details

Details for the file django_pony_forms-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: django_pony_forms-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/2.7.16

File hashes

Hashes for django_pony_forms-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d0dfe55d9fef18eecb78b93a270078824550b115555acdbe5c63fab35c26b83
MD5 8af8012660dbf5aff8f12f8c38e654d1
BLAKE2b-256 5d485c357a9e6ab4b2465330bd834df86c8834274b81bd0a5e425cbebebfc367

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