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:
- Add
django_ui_formsto yourINSTALLED_APPSin your Django settings:
INSTALLED_APPS = [
...
'django_ui_forms',
]
- Create your forms by extending
BootstrapBaseUiFormsorTailwindBaseUiForms:
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__'
- 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'
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f4e9d90c2c60dd4955b59753a9c0ad48484a26760d829cf7bc97cdb2f3f5c7d
|
|
| MD5 |
910d067d1f5b15ea7529984b993921fd
|
|
| BLAKE2b-256 |
de35cce3167afcc7e254e1a7ac7f68da5cde5e7ddca9b2bcabde9a661a53e69c
|
File details
Details for the file django_ui_forms-1.1-py3-none-any.whl.
File metadata
- Download URL: django_ui_forms-1.1-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df2bdd8669c5f18638dbfbe1f5d0526f545d7184e264c2fef0578ef52b796714
|
|
| MD5 |
fb20415b2628198ee87ec696c98dd366
|
|
| BLAKE2b-256 |
7d1a94d1b6886408d69e649fe2dd178069b2f0b54dc3ba0c86da93487b70f4df
|