This package, pi-sdk-django, helps you quickly scaffold, configure, and integrate all
necessary components for using Pi Network payments, authentication,
and user flows with a Next.js project. It is designed for modern
Django apps that want a working,
idiomatic Pi payment and authentication experience with minimal
boilerplate.
This guide demonstrates how to integrate the Pi SDK into a Django app. This example shows how to initialize the Pi SDK, authenticate a Pioneer, and create a payment request inside a Pi app.
The pi-sdk-django
package
is part of the “Ten Minutes to Transactions” effort described in this
video.
If you, or your GenAI agent, are planning to use the Django for your app, it is highly suggested that you use this package rather than implement transaction processing by hand with the core Pi SDK. The three way handshake between client, server, and the Pi servers required is provded for you.
Note: Pi SDK authentication and payment features require the application to run inside the Pi Browser.
While this process is covered in the Getting Started Guide, here is a brief reminder of the steps you need to take. Application registration is also discussed in the video.
http://localhost:3000. The actual port is between you and your development server.pi-sdk-django as a dependency in your Django projectpip install pi-sdk-djangopi-sdk-django-installThis will generate:
routes/pi_payment/ directory with individual route handlersroutes/pi_payment/index.ts - Router that exports all routesapp.example.ts - Example Django app setup