Skip to main content

django-dynamicforms

Dynamically add forms to your site through the admin interface.

With django-dynamicforms you can:

  • add forms through the admin interface

  • add (custom) form fields through the admin interface

  • reuse form fields in different forms

  • customize predefined forms through the admin interface

  • send personalized e-mails to submitters of dynamicforms

  • download data posted to forms as CSV

Install

  • pip install django-dynamicforms

  • add 'dynamicforms' to your INSTALLED_APPS

  • add (r'^dynamicforms/', include('dynamicforms.urls')) to your urls.py

Dependencies

django >= 1.3, html2text

Settings

There are two optional settings: DYNAMICFORM_TYPES and DYNAMICFIELD_TYPES, which define custom form and field types respectively. For example:

DYNAMICFORM_TYPES = {
    'newsletter-subscription': {
        'VERBOSE_NAME':   'Newsletter subscription',
        'BASE_FORM':      'newsletters.forms.SubscriptionForm',
        'SUCCESS_URL':    '/newsletter/thanks/',
        'TEMPLATE':       'dynamicforms/form.html',
        'TAG_TEMPLATE':   'dynamicforms/_form.html',
        'EMAIL_TEMPLATE': 'dynamicforms/notification.html',
    },
}

DYNAMICFIELD_TYPES = {
    'phone': {
        'VERBOSE_NAME': 'Phone number',
        'FIELD':        'phone.forms.PhoneField',
        'HAS_CHOICES':  False,
        'DEFAULT':      '',
        'WIDGET':       'django.forms.TextInput'
    },
}

Response e-mails are sent from settings.DEFAULT_FROM_EMAIL. Notification e-mails are sent from settings.SERVER_EMAIL.

Usage

Template tag

Every form has its own page, but can also be included in other pages with:

{% load dynamicform_tags %}
...
{% show_dynamicform %}

It will always post to its own url, though, and validation errors will have to be corrected there.

Templates

The templates used to render dynamicforms can be overridden by custom form types, but default to: - dynamicforms/form.html for the form url - dynamicforms/_form.html for the template tag - dynamicforms/notification.eml for the notification e-mail

Wishlist

  • adapt labels/help_text/… of (predefined) base form fields

  • nicer report of data

  • optional integration with messages framework

  • dynamicformwizard

  • better/more tests

Metadata

Release files for django-dynamicforms 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-dynamicforms 0.1.2
File Size Uploaded Provenance
django-dynamicforms-0.1.2.tar.gz 10.2 kB Without provenance Details

Release files / django-dynamicforms-0.1.2.tar.gz

Download URL django-dynamicforms-0.1.2.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
92d57590dec242dbe873940234588c983f0fcfb4d8b1389046629a1a89862990
BLAKE2b-256 checksum
How to use checksums
972b7f9dec2147352e7e8e1d059b29433a84876e68abbea8191abdc132dff05a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-dynamicforms 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page