Skip to main content

So simple you'll burst into tears right away.

Project description

The eleventy-eleventh email registration app for Django.

But this one does not feed your cat.

https://travis-ci.org/matthiask/django-email-registration.png?branch=master

Usage

This example assumes you are using a recent version of Django, jQuery and Twitter Bootstrap.

  1. Install django-email-registration using pip.

  2. Copy this code somewhere on your login or registration page:

    <h2>{% trans "Send an activation link" %}</h2>
    <form method="post" action="{% url "email_registration_form" %}"
        class="well" id="registration">
      {% csrf_token %}
      <div class="controls">
        <input id="id_email" type="text" name="email" maxlength="30"
          placeholder="{% trans "Email address" %}">
      </div>
      <button type="submit" class="btn btn-primary">
        {% trans "Register" %}</button>
    </form>
    
    <script>
    function init_registration($) {
      $('#registration').on('submit', function() {
        var $form = $(this);
        $.post(this.action, $form.serialize(), function(data) {
          $('#registration').replaceWith(data);
          init_registration($);
        });
        return false;
      });
    }
    $(init_registration);
    </script>

    (Alternatively, include the template snippet registration/email_registration_include.html somewhere.)

  3. Add email_registration to INSTALLED_APPS and include email_registration.urls somewhere in your URLconf.

  4. Presto.

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

django-email-registration-0.3.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

django_email_registration-0.3.1-py2.py3-none-any.whl (14.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-email-registration-0.3.1.tar.gz.

File metadata

File hashes

Hashes for django-email-registration-0.3.1.tar.gz
Algorithm Hash digest
SHA256 223d90b438cb70cd2a0c9af1c4b3c23a0c2fad9b2ca0f76204c527b96b994c87
MD5 f056cd1b166fa4a46bf7e7eb7eb3346b
BLAKE2b-256 71f630dab2abbef8ea4b55f2301ba0436270c58c15612b3502464edcf4f736ca

See more details on using hashes here.

File details

Details for the file django_email_registration-0.3.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_email_registration-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6859145b21280597ff82e2a4a7114eb0927cc64d331ecd6d0150ecc707d71dc0
MD5 a63c228b4c4b6bf8f04b91c39b1780f3
BLAKE2b-256 06ce62218d774911dd72e93f4c4863d8fa572002f6d8a51ea471a651710a51ad

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