Skip to main content

A Django app that provides enhanced form rendering with Bootstrap styles.

Project description

Latest Version Downloads License

Django Bootstrap Forms is a Django app that provides enhanced form rendering with Bootstrap styles.

Installation

  1. Install the package using pip:

    pip install nvs-bootstrap-forms
  2. Add ‘bootstrap_forms’ to your INSTALLED_APPS in the Django settings:

    INSTALLED_APPS = [
        # ...
        'bootstrap_forms',
        # ...
    ]
  3. Include Bootstraps css and js links in your html:

    <!doctype html>
    <html lang="en">
      <head>
        <!-- Your headers goes here -->
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
      </head>
      <body>
        <!-- Your content goes here -->
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
      </body>
    </html>

Usage

  1. Load Bootstrap Forms in your template:

    {% load bootstrap_forms_tags %}
  2. Use the `bootstrap_form` template tag to render your form:

    <form method="post">
      {% csrf_token %}
      {% bootstrap_form form %}
      <button type="submit">Submit</button>
    </form>

    This will render the form with Bootstrap styles.

  3. Customization:

    • You can customize the rendering of individual fields by using the field_order and other attributes in your form fields.

    • For advanced customization, you can extend the provided BootstrapFormRendererNode class in the bootstrap_forms.templatetags.bootstrap_forms_tags module.

Contributing

Feel free to contribute by opening issues or submitting pull requests. Please read the Contributing Guidelines for more details.

License

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

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nvs-bootstrap-forms-0.1.tar.gz (9.5 kB view hashes)

Uploaded Source

Built Distribution

nvs_bootstrap_forms-0.1-py3-none-any.whl (9.7 kB view hashes)

Uploaded Python 3

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