使用Django创建RESTful API
Agenda
1.What is an api
Api refers to application programming interface
It is a set of subroutine definitations, protocols and tools for building application software.
It helps in connecitng various software components
An api make it easier for developers to use certain technologies in building applications by using certain predefined operations.
2.Introduciton to Rest Framework
- It describe an architecture which stands for REpresentaionl State Transfer
- It is used for web based architecture for data communication
- It uses HTTP to make calls between machines
The following HTTP methods are most commonly used in a REST based architecture:
GET records and retrieve the data
PUT is used to change the state or update a resources which can be a file it can be object or any block
POST is usually used to create the resources
DELETE is used to remove that resource
3.What is REST API?
When Web Service use REST architecture, they are called RESTFul APIs or REST APIs.
A REST API is a set of web addresses that respond with pure information, not a formatted web pge
An api returens json, which is a common format. You'll see all of information surrounded with quotation marks, {} ,[] and descriptive titles for each bit of info.
4.Demo-Create a Restful api
Open the terminal and type the following command for Django installation
pip install djangorestframework
python manage.py makemigrations
python manage.py migrate
Create a user
run server:
python manage.py runserver
References:
Video Django Rest Framework | How to Create a RESTful API Using Django | Django Tutorial | Edureka
最新文章
- 为IEnumerable<;T>;添加RemoveAll<;IEnumerable<;T>;>;扩展方法--高性能篇
- android中接口和抽象类的区别
- Android下载更新代码
- oc程序编译【-framework Foundation 编译】
- javaSE之如何将一个文档显示出来(,txt,.doc,.....)
- 截获控制台程序关闭事件(SetConsoleCtrlHandler)
- bzoj1190
- android程序启动画面之Splash总结[转]
- Function.prototyoe.call.apply
- selenium3.x 踏坑记
- 03 CheckBox 复选框
- Unity编辑器扩展-Custom List, displaying data your way
- maven插件运行过程中自动执行sql文件
- 中级 jQuery 了解
- [spark] spark 特性、简介、下载
- phpstorm 初体验
- 【RF库Collections测试】Remove From List
- ftp.GetResponse() 无法连接到远程服务器
- sourceinsight - imsoft.cnblogs
- Jenkins进阶-发布后自动创建git tag(5)