djangoreferrals

Django: Implementing a referral program


I have an ecommerce website that works in a classical way: people sign up, buy a product with their CC.

It uses the default Django auth system for users and registration and session framework.

Now I want to implement a referral system to my system where people can invite other people by giving their referral link (ie mysite.com/referral/123123/ ) and if a person signs up AND buys an item, the inviter gets 5$.

How can this the implemented ? For instance:


Solution

  • Define a special set of URLs (in your urls.py) for referral links. Pass them through a Python function that registers the referral and then send them to the normal view with the referral number as a parameter.

    Is this what you had in mind, or what else would you like to know?