Skip to main content

A Django reusable app to extend forms with Bootstrap and Tailwind CSS support

Project description

Django UI Forms

A Django reusable app to extend forms and provide UI with templates available for Bootstrap and Tailwind CSS.

https://pypi.org/project/django-ui-forms/

Features

  • Custom form handling with Bootstrap and Tailwind CSS support.
  • Easy to use and integrate into existing Django projects.
  • Flexible and reusable components for better form management.

Installation

You can install this package via pip:

pip install django-ui-forms

Usage

To use this package in your Django project, follow these steps:

  1. Add django_ui_forms to your INSTALLED_APPS in your Django settings:
INSTALLED_APPS = [
    ...
    'django_ui_forms',
]
  1. Create your forms by extending BootstrapBaseUiForms or TailwindBaseUiForms:
from django import forms
from django_ui_forms.forms import BootstrapBaseUiForms, TailwindBaseUiForms

class MyForm(BootstrapBaseUiForms, forms.Form):
    my_field = forms.CharField(label='My Field')

class MyModelForm(TailwindBaseUiForms, forms.ModelForm):
    class Meta:
        model = MyModel
        fields = '__all__'
  1. Update custom form renderer in your settings:
from django.forms.renderers import TemplatesSetting

class CustomFormRenderer(TemplatesSetting):
form_template_name = "bootstrap_forms_snipprt.html" # for Bootstrap
form_template_name = "tailwind_forms_snipprt.html" # for Tailwind

FORM_RENDERER = 'your_project_name.settings.CustomFormRenderer'
  1. Use the forms in your views and templates.

Example

See the examples/ directory for a complete example of how to use this package in a Django project.

Running Tests

Tests are Under Development

Contributing

Contributions are welcome! Please submit a pull request or open an issue.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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-ui-forms-1.1.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

django_ui_forms-1.1-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file django-ui-forms-1.1.tar.gz.

File metadata

  • Download URL: django-ui-forms-1.1.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.10

File hashes

Hashes for django-ui-forms-1.1.tar.gz
Algorithm Hash digest
SHA256 5f4e9d90c2c60dd4955b59753a9c0ad48484a26760d829cf7bc97cdb2f3f5c7d
MD5 910d067d1f5b15ea7529984b993921fd
BLAKE2b-256 de35cce3167afcc7e254e1a7ac7f68da5cde5e7ddca9b2bcabde9a661a53e69c

See more details on using hashes here.

File details

Details for the file django_ui_forms-1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_ui_forms-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 df2bdd8669c5f18638dbfbe1f5d0526f545d7184e264c2fef0578ef52b796714
MD5 fb20415b2628198ee87ec696c98dd366
BLAKE2b-256 7d1a94d1b6886408d69e649fe2dd178069b2f0b54dc3ba0c86da93487b70f4df

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