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

使用Django创建RESTful API的更多相关文章

  1. Django编写RESTful API(一):序列化

    欢迎访问我的个人网站:www.comingnext.cn 关于RESTful API 现在,在开发的过程中,我们经常会听到前后端分离这个技术名词,顾名思义,就是前台的开发和后台的开发分离开.这个技术方 ...

  2. Django编写RESTful API(四):认证和权限

    欢迎访问我的个人网站:www.comingnext.cn 前言: 按照前面几篇文章里那样做,使用Django编写RESTful API的基本功能已经像模像样了.我们可以通过不同的URL访问到不同的资源 ...

  3. python 全栈开发,Day95(RESTful API介绍,基于Django实现RESTful API,DRF 序列化)

    昨日内容回顾 1. rest framework serializer(序列化)的简单使用 QuerySet([ obj, obj, obj]) --> JSON格式数据 0. 安装和导入: p ...

  4. Django编写RESTful API(二):请求和响应

    欢迎访问我的个人网站:www.comingnext.cn 前言 在上一篇文章,已经实现了访问指定URL就返回了指定的数据,这也体现了RESTful API的一个理念,每一个URL代表着一个资源.当然我 ...

  5. 利用Django实现RESTful API(一)

    RESTful API现在很流行,这里是它的介绍 理解RESTful架构和 RESTful API设计指南.按照Django的常规方法当然也可以实现REST,但有一种更快捷.强大的方法,那就是 Dja ...

  6. Django之Restful API

    理解Restful架构:http://www.ruanyifeng.com/blog/2011/09/restful RESTful设计指南:http://www.ruanyifeng.com/blo ...

  7. 【从0到1,搭建Spring Boot+RESTful API+Shiro+Mybatis+SQLServer权限系统】03、创建RESTful API,并统一处理返回值

    本节应用Spring对RESTful的支持,使用了如@RestController等注解实现RESTful控制器. 如果对Spring中的RESTful不太明白,请查看相关书籍 1.创建一个数据对象, ...

  8. Django编写RESTful API(五):添加超链接提高模型间的关联性

    前言 在第四篇中,加入了用户模型,以及相关的认证和权限的功能.但是我们在使用的时候,会发现在访问http://127.0.0.1:8000/users/时看到的用户列表,不能够直接点击某个链接然后查看 ...

  9. Django编写RESTful API(六):ViewSets和Routers

    欢迎访问我的个人网站:www.comingnext.cn 前言 在本系列的文章中,我在第一篇和第二篇文章中写的编写Django视图时,使用的都是基于函数的方法,并且每个视图函数之前都会加一个djang ...

随机推荐

  1. 对象数组自定义排序--System.Collections.ArrayList.Sort()

    使用System.Collections.ArrayList.Sort()对象数组自定义排序 其核心为比较器的实现,比较器为一个类,继承了IComparer接口并实现int IComparer.Com ...

  2. http接口和webservice接口的区别

    web service(SOAP)与HTTP接口的区别 什么是web service? soap请求是HTTP POST的一个专用版本,遵循一种特殊的xml消息格式Content-type设置为: t ...

  3. JS打开url的几种方法

    在新标签页中打开 window.open(loginurl_withaccout, "_blank"); 下图中根据后台返回的url以及用户名密码字段,以及用户名密码动态生成了带账 ...

  4. FCC-学习笔记 Boo who

    FCC-学习笔记  Boo who 1>最近在学习和练习FCC的题目.这个真的比较的好,推荐给大家. 2>中文版的地址:https://www.freecodecamp.cn/;英文版的地 ...

  5. itextpdf5操作表格

    下面是一些对表格排版的常用方法,是在制作pdf的时候通过查看ipa和一些博客积累下来的. 包括,表格的宽度,对齐方式,表的页眉页脚,前后间距,padding: 单元格对齐方式,线条设置,段落于单元格之 ...

  6. 【转载】CMake 两种变量原理

    原文地址:https://cslam.cn/archives/c9f565b5.html 摘要: 本文记录一下 CMake 变量的定义.原理及其使用.CMake 变量包含 Normal Variabl ...

  7. Linux中断管理 (3)workqueue工作队列【转】

    转自:https://www.cnblogs.com/arnoldlu/p/8659988.html 目录: <Linux中断管理> <Linux中断管理 (1)Linux中断管理机 ...

  8. BCD解密

    #include<stdio.h> int main(void) { int num; scanf_s("%d", &num); printf( * + num ...

  9. 201871010109-胡欢欢《面向对象程序设计(java)》第十二周学习总结

    201871010109-胡欢欢<面向对象程序设计(java)>第十二周学习总结   内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这 ...

  10. 《面向对象程序设计(java)》第十周学习总结

    201871010115     马北<面向对象程序设计(java)>第十周学习总结 项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh ...