This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This is a fork of django-registration(redux) that provides basic support for email referrals.


pip install django-registration-redux-referrals

or simply download the zip, extract it and copy the ‘registration’ directory into PYTHONPATH


Configuration instructions remains similar to django-registration-redux. Here is the full documentation:

After installation and configuration, all you need is to write the view to send referral emails.


# Import the ReferCodes and Refer models.
# The ReferCodes model holds refer codes generated by users.
# The Refer model holds referred users and the referees. Both are instances of django.contrib.auth.models.User

from registration.models import ReferCodes, Refer

# The ReferForm is a simple form with only an email field. You can implement your own if you like.

from registration.forms import ReferForm

# gen_code is a utility for generating the 20-character refer code

from registration.utils import gen_code

from django.core.mail import send_mail
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.urlresolvers import reverse

def refer(request):
    form = ReferForm()
    if request.POST:
        code = gen_code()
        obj, new = ReferCodes.objects.get_or_create(code=code, user=request.user)
        if new:
            # Generation of the refer URL
            # registration_register is the name of the registration url
            # Please note the structure of the URL
            url = 'http://' + get_current_site(request) + reverse('registration_register') + code + '/'
            # The refer email message
            message = "Hello, \n Please register for the writing service here {0}".format(url)
            # Sending the refer email.
            send_mail('Subject here', message, settings.EMAIL_HOST_USER,
                      [request.POST['email']], fail_silently=False)


Referred users who register will now be saved to the Refers table and you will be able to query them and their referees.

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting