2๐
โ
I implemented this feature in my book โDjango 1.0 Website Developmentโ. You can view the relevant chapter online at โinviting friends via emailโ.
I used the sessions framework to track clicks on referral links. When a link is clicked, the session is populated with the id of the invitation. When the user registers, the session is checked for an invitation id.
The formatting of the code is a bit off on that page. Iโve just noticed this. I will let the publisher know. You can download the source code with proper formatting from the bookโs page.
๐คAyman Hourieh
Source:stackexchange.com