使用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
使用Django创建RESTful API的更多相关文章
- Django编写RESTful API(一):序列化
欢迎访问我的个人网站:www.comingnext.cn 关于RESTful API 现在,在开发的过程中,我们经常会听到前后端分离这个技术名词,顾名思义,就是前台的开发和后台的开发分离开.这个技术方 ...
- Django编写RESTful API(四):认证和权限
欢迎访问我的个人网站:www.comingnext.cn 前言: 按照前面几篇文章里那样做,使用Django编写RESTful API的基本功能已经像模像样了.我们可以通过不同的URL访问到不同的资源 ...
- python 全栈开发,Day95(RESTful API介绍,基于Django实现RESTful API,DRF 序列化)
昨日内容回顾 1. rest framework serializer(序列化)的简单使用 QuerySet([ obj, obj, obj]) --> JSON格式数据 0. 安装和导入: p ...
- Django编写RESTful API(二):请求和响应
欢迎访问我的个人网站:www.comingnext.cn 前言 在上一篇文章,已经实现了访问指定URL就返回了指定的数据,这也体现了RESTful API的一个理念,每一个URL代表着一个资源.当然我 ...
- 利用Django实现RESTful API(一)
RESTful API现在很流行,这里是它的介绍 理解RESTful架构和 RESTful API设计指南.按照Django的常规方法当然也可以实现REST,但有一种更快捷.强大的方法,那就是 Dja ...
- Django之Restful API
理解Restful架构:http://www.ruanyifeng.com/blog/2011/09/restful RESTful设计指南:http://www.ruanyifeng.com/blo ...
- 【从0到1,搭建Spring Boot+RESTful API+Shiro+Mybatis+SQLServer权限系统】03、创建RESTful API,并统一处理返回值
本节应用Spring对RESTful的支持,使用了如@RestController等注解实现RESTful控制器. 如果对Spring中的RESTful不太明白,请查看相关书籍 1.创建一个数据对象, ...
- Django编写RESTful API(五):添加超链接提高模型间的关联性
前言 在第四篇中,加入了用户模型,以及相关的认证和权限的功能.但是我们在使用的时候,会发现在访问http://127.0.0.1:8000/users/时看到的用户列表,不能够直接点击某个链接然后查看 ...
- Django编写RESTful API(六):ViewSets和Routers
欢迎访问我的个人网站:www.comingnext.cn 前言 在本系列的文章中,我在第一篇和第二篇文章中写的编写Django视图时,使用的都是基于函数的方法,并且每个视图函数之前都会加一个djang ...
随机推荐
- Asp.Net MVC 的19个管道事件
httpApplication调用ProcessRequest方法,内部执行19个管道事件,如下 BeginRequest 开始处理请求 AuthenticateRequest 授权验证请求开始,获 ...
- 阿里Jvm必问面试题及答案
什么是Java虚拟机?为什么Java被称作是“平台无关的编程语言”? Java虚拟机是一个可以执行Java字节码的虚拟机进程.Java源文件被编译成能被Java虚拟机执行的字节码文件. Java被设计 ...
- EurekaServer自动装配及启动流程解析
在开始本篇文章之前,我想你对SpringCloud和SpringBoot的基本使用已经比较熟悉了,如果不熟悉的话可以参考我之前写过的文章 本篇文章的源码基于SpringBoot2.0,SpringCl ...
- electron——ipcMain模块、ipcRenderer模块
ipcMain 从 主进程 到 渲染进程 的异步通信. ipcMain模块是EventEmitter类的一个实例. 当在主进程中使用时,它处理从渲染器进程(网页)发送出来的异步和同步信息. 从渲染器进 ...
- SAP 同一个序列号可以同时出现在2个不同的HU里?
SAP 同一个序列号可以同时出现在2个不同的HU里? 答案是可以的. 如下图示,HU 180141003288里的序列号11810010540121, 而序列号11810010540121已经出现在另 ...
- ca动画
//动画上下文-(void)animationOfUIKit{ UIView *redView=[[UIView alloc]initWithFrame:CGRectMake(10, 10, 1 ...
- Win2003下安装PHP5.2.0+MySql5.0.27+PHPMyAdmin2.9.1的配置方法
先下载所需要安装的东东~~ PHP 5.2.0 官方下载地址:http://www.php.net/downloads.php mysql-5.0.27 官方下载地址:http://dev.mysql ...
- 001-Zabbix 服务安装
Zabbix 服务安装 [官方地址]点我快速打开文章 1.安装 Zabbix 1.1 下载 Zabbix 清华源 rpm -ivh https://mirrors.tuna.tsinghua.edu. ...
- NVIDIA-SMI参数解析
第一栏的Fan:N/A是风扇转速,从0到100%之间变动,这个速度是计算机期望的风扇转速,实际情况下如果风扇堵转,可能打不到显示的转速.有的设备不会返回转速,因为它不依赖风扇冷却而是通过其他外设保持低 ...
- React中ref的三种用法 可以用来获取表单中的值 这一种类似document.getXXId的方式
import React, { Component } from "react" export default class MyInput extends Component { ...