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.
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_forms
to yourINSTALLED_APPS
in your Django settings:
INSTALLED_APPS = [
...
'django_ui_forms',
]
- Create your forms by extending
BootstrapBaseUiForms
orTailwindBaseUiForms
:
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
File details
Details for the file django-ui-forms-1.0.tar.gz
.
File metadata
- Download URL: django-ui-forms-1.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1413e093af3c36675470b87d6cf8da52d9f82779bf226e55c8993b93dd62917 |
|
MD5 | 38b5762554a0ad360679bdb282f49ce1 |
|
BLAKE2b-256 | 2ac14a9b6cde77a01524e8aefa2a37a0e2cdc1ad3e04c6675403639954dbfb1b |
File details
Details for the file django_ui_forms-1.0-py3-none-any.whl
.
File metadata
- Download URL: django_ui_forms-1.0-py3-none-any.whl
- Upload date:
- Size: 4.7 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 | d49ba9c90eeeac0c7c76bd5e2df1f16b5100bbc5e2ce7cc176eb7f5f095ae9f2 |
|
MD5 | f61cc0f99469cfb86ad360057b90f3d9 |
|
BLAKE2b-256 | 8aee1ef934e3093d2f108167be5af66b1ec4f5776a742843460757f583342cb4 |