This tutorial describes how to integrate Django with PayPal by implementing a simple online store that sells downloadable content. Django is a powerful, Python-based web framework suitable for rapidly building web applications. It has an active community, is easy to use, and drives a number of prominent sites. PayPal offers an easy way to send and receive payments, has a comprehensive API, and is suitable for developers to use for online transactions.
If you don’t already have one, create a PayPal developer account at https://developer.paypal.com/ for testing. After creating your main developer account, you will also need to create seller and buyer test accounts. If you want to start accepting real money, you will also need to sign up for a live account at https://www.paypal.com/
PayPal provides a number of methods for authenticating a transaction once the buyer returns to your site. This example uses the PDT method of authenticating transactions, so you need to enable PDT on your seller account. Instructions for doing this are at https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/howto_html_paymentdatatransfer. When updating the configuration settings on your Django application, use the PDT token obtained from the above link.