Django & Django Rest Framework (DRF)
Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. DRF is used to build robust and scalable RESTful APIs.
pip install django djangorestframeworkdjango-admin startproject ewalletly
cd ewalletly
python manage.py startapp apifrom django.db import models
class Wallet(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
balance = models.DecimalField(max_digits=10, decimal_places=2)
currency = models.CharField(max_length=3)
from rest_framework import serializers
from .models import Wallet
class WalletSerializer(serializers.ModelSerializer):
class Meta:
model = Wallet
fields = '__all__'
Last updated