Issue
I have database full of useful information, which I want to develop an API for using Django rest framework. This API will be used by mobile app so user and user authentication. I want the users of this App to pay a subscription fee for the services. What is the best way to go about this using django??
I just need a direction, I thought about dividing user to groups paid and unpaid Paid group have access to all, unpaid only have a portion of every service, using django permissions group. I do have a strong feeling that this not secure or the way to do it.
I also thought about Token Authorisation, meaning people who have the token have access others have limited access. Is this good strategy?
Please any help is immensely appreciated 🙏.
Solution
There are different ways to tackle it, such as
- How to create subscription service using Django
- How to Create a Subscription SaaS Application with Django and Stripe
- Django Stripe Subscriptions
- Django PayPal Subscriptions with Django-PayPal
- Implementing Paddle Payments for my Django SaaS
- Setting up Subscriptions And Recurring Payments Using Django and Stripe
- Django and Stripe subscriptions — Part 2
From all of them, OP will see the need to handle subscriptions as well as payments. For that, I would say, most people, use Stripe or similar.
Let's say OP decided to go with Stripe. Then one can have models that keep track of the user's Stripe customer ID as well as to know the state of the subscription.
Then in one's views and templates, the logic can consider the subscription state and render different things accordingly.
Answered By - Gonçalo Peres
Answer Checked By - David Marino (JavaFixing Volunteer)