Metadata-Version: 2.1
Name: django-email-registration
Version: 0.5.0
Summary: So simple you'll burst into tears right away.
Home-page: http://github.com/matthiask/django-email-registration/
Author: Matthias Kestenholz
Author-email: mk@406.ch
License: BSD License
Platform: OS Independent
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
License-File: LICENSE

=========================
django-email-registration
=========================

The eleventy-eleventh email registration app for Django.

But this one does not feed your cat.

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


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. Make sure that Django is able to
   `send emails <https://docs.djangoproject.com/en/stable/topics/email/>`_.

5. Presto.


