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 2.0 - 3.0 and Python 3.6-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-1.0.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distributions

django_pony_forms-1.0.0-py3.7.egg (5.4 kB view details)

Uploaded Source

django_pony_forms-1.0.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_pony_forms-1.0.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.5

File hashes

Hashes for django_pony_forms-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7b96ec4e38a4e1c9999eeaea59bb3026836d8b3f0e7aaa6c537a89437ba70ac7
MD5 2b3591b68ab4de75e649840b32900ec5
BLAKE2b-256 2cd85c1d236ab412288d4eb43a73c1d43ca6254aa230183d1280c980c334bc6f

See more details on using hashes here.

File details

Details for the file django_pony_forms-1.0.0-py3.7.egg.

File metadata

  • Download URL: django_pony_forms-1.0.0-py3.7.egg
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.5

File hashes

Hashes for django_pony_forms-1.0.0-py3.7.egg
Algorithm Hash digest
SHA256 623c036f87b33d1564d9a2a542f483340f32e96860856943e1c2acd377d81998
MD5 6aa1f3f5a4bb9571e3cb002fbccf1c77
BLAKE2b-256 aff43806bbdf32d4afe525f3c207999a248e84ffea8fc1551b90734bdbb14a5b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_pony_forms-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.5

File hashes

Hashes for django_pony_forms-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28805603a2907930047b71391beb3a2399e95d10b5c21614eb5bbd4274509ac8
MD5 457874da3e2e08d6167a4210e4e8d1bc
BLAKE2b-256 a355562d7f3883c512e22757160d460801e20bf14284b5e1a02b7a0d3bf4c728

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