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.
Usage
This example assumes you are using a recent version of Django, jQuery and Twitter Bootstrap.
Install django-email-registration using pip.
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.)
Add email_registration to INSTALLED_APPS and include email_registration.urls somewhere in your URLconf.
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
File details
Details for the file django-email-registration-0.1.1.tar.gz
.
File metadata
- Download URL: django-email-registration-0.1.1.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 107a4cb3a379904be5bd5e9ba52826c29362e6d999837197c3803774499cbbfc |
|
MD5 | 57c357a61d918f8efb48fea99de88c6a |
|
BLAKE2b-256 | b82c382affa4df86fa4dd05c663fe598b04fb25a388d1f1cb3dc0e0f6d163816 |