Book Image

Learning Website Development with Django

Book Image

Learning Website Development with Django

Overview of this book

Table of Contents (18 chapters)
Learning Website Development with Django
Credits
About the Author
About the Reviewers
Preface
Index

Inviting Friends Via Email


Enabling our users to invite their friends carries many benefits. People are more likely to join our site if their friends are already using it. And after they join, they will also invite their friends and so on, which means more and more users for our application. Therefore, it is a good idea to offer an "invite a friend" feature. This is actually a common functionality found in many Web 2.0 applications.

Building this feature requires the following components:

  • An Invitation data model to store invitations in the database.

  • A form in which users can type the emails of their friends and send invitations.

  • An invitation email with an activation link.

  • A mechanism for processing activation links sent in email.

Throughout this section, we will implement each component. But because this section involves sending emails, we first need to configure Django to send emails by adding some options to settings.py. So open settings.py and add the following lines:

SITE_HOST = '127.0...