After weeks of learning, debugging, and testing β I'm thrilled to announce that my Django-based portfolio now includes a full-fledged Template Store with Razorpay integration! ππ³
Users can now purchase and download premium templates directly from my site. Everything is secure, dynamic, and admin-friendly!
The admin dashboard lets me handle everything with ease β from managing templates to tracking revenue.
class Template(models.Model):
title = models.CharField(max_length=100)
price = models.DecimalField(max_digits=8, decimal_places=2)
is_active = models.BooleanField(default=True)
download_file = models.FileField(upload_to='templates/')
Razorpay integration handles all transactions securely. Upon successful payment, users receive email confirmation and can access their purchased templates via the dashboard.
client = razorpay.Client(auth=("RAZORPAY_KEY_ID", "RAZORPAY_SECRET_KEY"))
payment = client.order.create({
"amount": int(price * 100),
"currency": "INR",
"payment_capture": "1"
})
After a successful purchase, the system sends an auto-generated email with the template as an attachment.
send_mail(
subject="Your Template Purchase",
message="Thank you for your purchase!",
from_email=settings.DEFAULT_FROM_EMAIL,
recipient_list=[user.email],
fail_silently=False,
html_message=render_to_string("email_template.html", context),
)
All purchases are logged in the admin panel for transparency and revenue tracking. Admin can view, filter, or download the data.
class Purchase(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
template = models.ForeignKey(Template, on_delete=models.CASCADE)
transaction_id = models.CharField(max_length=100)
created_at = models.DateTimeField(auto_now_add=True)
- Django + PostgreSQL + Bootstrap - Razorpay payment gateway - Cloudinary for media hosting - SEO-ready design - reCAPTCHA for security - Responsive template preview - Custom Admin Panel
python manage.py runserver
π Live Website :https://www.vamsikrishna.site/
π GitHub Repo :https://lnkd.in/gkUc6aRu
π₯ Demo Video :https://www.vamsikrishna.site/templates/
This is more than a personal project β it's open-source! Whether you're into Django, payments, UI/UX, or want to practice PRs β I welcome all contributions, suggestions, and feature ideas!
Likes β’ 5 Views β’ Apr 14, 2025