Skip to main content

The easiest and most flexible Django CMS Form builder w/ ReCaptcha v2 support!

Project description

Latest Version Downloads License CodeFactor

This project requires django-cms v3.6 or higher to be properly installed and configured.

This package is compatible with Aldryn.

This version uses https://github.com/praekelt/django-recaptcha for ReCaptcha capabilities.

Quickstart

  1. Install djangocms-forms-maintained:

    pip install djangocms-forms-maintained
  2. Add djangocms_forms to INSTALLED_APPS:

    INSTALLED_APPS = (
        ...
        'djangocms_forms',
        ...
    )
  3. Sync database tables (requires south>=1.0.1 if you are using Django 1.6.x):

    python manage.py migrate
  4. Add djangocms_forms.urls to your project’s urls module or create a django CMS page to hook the application into. In Advanced Settings, set its Application to Forms (this requires a server restart):

    urlpatterns = patterns(
        ...
        path('', include('djangocms_forms.urls')),
        ...
    )
  5. To use reCAPTCHA for spam protection, you need to sign up for an API key pair for your site:

    DJANGOCMS_FORMS_RECAPTCHA_PUBLIC_KEY = '<recaptcha_site_key>'
    DJANGOCMS_FORMS_RECAPTCHA_SECRET_KEY = '<recaptcha_secret_key>'

You can register a new site via https://www.google.com/recaptcha/admin

Configuration

Plugin(s) Module - If module is None, plugin is grouped Generic group:

DJANGOCMS_FORMS_PLUGIN_MODULE = _('Generic')

Name of the plugin:

DJANGOCMS_FORMS_PLUGIN_NAME = _('Form')

The path to the default template used to render the template:

DJANGOCMS_FORMS_DEFAULT_TEMPLATE = 'djangocms_forms/form_template/default.html'

or override the Form Template dropdown choices to have different template options:

DJANGOCMS_FORMS_TEMPLATES = (
    ('djangocms_forms/form_template/default.html', _('Default')),
)

HTML5 required - When set to True all required fields inputs will be rendered with HTML5 required=required attribute:

DJANGOCMS_FORMS_USE_HTML5_REQUIRED = False

By default, djangocms-forms adds additional css classes to all form inputs. e.g. a Text field generates an <input class="textinput"> You can override this to integrate your own CSS framework:

DJANGOCMS_FORMS_WIDGET_CSS_CLASSES = {'__all__': ('form-control', ) }

e.g. the above setting would generate <input class"form-control" .... for all fields.

By default, djangocms-forms will redirect a successful form submission after 1000 milliseconds (1 second). You may provide your own redirect delay value for all forms site-wide via settings:

DJANGOCMS_FORMS_REDIRECT_DELAY = 10000  # 10 seconds

or on a per-form basis via the redirect_delay field. The order of precedence for the redirect value is always:

instance.redirect_delay > DJANGOCMS_FORMS_REDIRECT_DELAY > 1000 (default)

As of 202206141310 you can now specify new FORMAT_CHOICES for the form, since tablib seems to be a bit finicky in the latest version:

DJANGOCMS_FORMS_FORMAT_CHOICES = (
    ("csv", _("CSV")),
    ("json", _("JSON")),
    ("yaml", _("YAML")),
    ("xlsx", _("Microsoft Excel")),
)

Preview

http://mishbahr.github.io/djangocms-forms/assets/resized/djangocms_forms_001.jpeg http://mishbahr.github.io/djangocms-forms/assets/resized/djangocms_forms_005.jpeg http://mishbahr.github.io/djangocms-forms/assets/resized/djangocms_forms_002.jpeg http://mishbahr.github.io/djangocms-forms/assets/resized/djangocms_forms_003.jpeg http://mishbahr.github.io/djangocms-forms/assets/resized/djangocms_forms_004.jpeg

You may also like the original author’s plugins…

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

djangocms-forms-maintained-202206141440.tar.gz (138.8 kB view details)

Uploaded Source

Built Distribution

djangocms_forms_maintained-202206141440-py2.py3-none-any.whl (153.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file djangocms-forms-maintained-202206141440.tar.gz.

File metadata

File hashes

Hashes for djangocms-forms-maintained-202206141440.tar.gz
Algorithm Hash digest
SHA256 6a75383d28624c000159f44d21e644362b1c1694ec833c35978b017d7d67354d
MD5 7c8fa46533e1221e6c18803a4aa9cc43
BLAKE2b-256 0cf620cbd0c9047f2b53200224ff31b715855288247e5b6b0977e322e9f04c26

See more details on using hashes here.

File details

Details for the file djangocms_forms_maintained-202206141440-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for djangocms_forms_maintained-202206141440-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 290a28214fc65f1936d06aa98ea793da5218e2ae2449e0c20625b32dd965d194
MD5 b235b50ee8fb0144ad97899994461d8a
BLAKE2b-256 9379ee443fd77e59e00db09e3ca3d5e33cebcb593fcac15427fc517387191540

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