Steps to create RestAPI with Django Rest Framework

Steps
1- Create a Project
2- Create an App
3- Create urls.py and Serializers.py file in your app
4- Create a model
5- Go to Serialzers.py file and create a class like TestSerializer(serliazer.ModelSerializer) and add model and fields values
6- Go to views file and create a class TestView(APIView) and create functions like get, post, put, and delete in it
7- Go to urls.py file and add path like path(“/”,TestView.as_view())
8- Create another path to delete an object like path(“/”,TestView.as_view())
Here you go, These are steps required to create restful api

原文链接:Steps to create RestAPI with Django Rest Framework

© 版权声明
THE END
喜欢就支持一下吧
点赞12 分享
Give light and people will find the way.
照亮前方的路,路就会被找到
评论 抢沙发

请登录后发表评论

    暂无评论内容