当前位置: 首页 > news >正文

好的家装设计河南做网站优化

好的家装设计,河南做网站优化,阿里巴巴国际站运营,win2003搭建wordpress一、RESTful设计风格 基础概念 全称:Representational State Transfer 1.资源 网络上的一个实体,每个资源都有一个独一无二的URL与之对应;获取资源-直接访问URL即可 2.表现层 资源的表现形式 如HTML、xml、JPG、json等 3.状态转化 …

一、RESTful设计风格

基础概念

全称:Representational State Transfer

1.资源

        网络上的一个实体,每个资源都有一个独一无二的URL与之对应;获取资源-直接访问URL即可

2.表现层

资源的表现形式    如HTML、xml、JPG、json等

3.状态转化

访问一个URL即发生一次客户端和服务端得交互;此次交互将会涉及到数据和状态得变化

客户端需要通过某些方式接触具体得变化    如GET、POST、PUT、PATCH、DELETE

设计原则

1.协议    - http/https

2.域名

域名中体现出api字样

https://api.example.com/v1 或 https://example.org/api/.

3.版本

https://api.example.com/v1

 4.路径

路径中避免使用动词,资源用名词表示

5.HTTP动词语义

GET、POST、PUT、PATCH、DELETE

示例

6.巧用查询字符串

7.状态码

1)用HTTP响应码表达

2)自定义内部code进行响应

{’code‘:'00000','msg':'success','data':{}}

二、用户系统 - ORM

model

class UserProfile(models.Model):username=models.BigAutoField(verbose_name="用户名",primary_key=True)nickname=models.CharField(max_length=20,verbose_name="昵称")password=models.CharField(max_length=32)email = models.EmailField()phone=models.CharField(max_length=11)avatar=models.ImageField(upload_to='avatar',null=True)sign=models.CharField(max_length=50,verbose_name="个人签名",default=default_sign)info=models.CharField(max_length=150,verbose_name="个人简介",default='')created_time=models.DateTimeField(auto_now_add=True)updated_time=models.DateTimeField(auto_now=True)class Meta:db_table = 'user_user_profile'

三、用户系统-注册

只处理后端

from models import UserProfile
import hashlib
# 数据校验 前后端都要做
class UserViews(APIView):def post(self,request):username = request.data['user']nickname = request.data['nick']email = request.data['email']password_1 = request.data['password_1']password_2 = request.data['password_2']phone = request.data['phone']# 参数基本检查if password_1 != password_2:return Response("密码不一致")# 用户名可不可用old_users = UserProfile.objects.filter(username=username)if old_users:return Response("用户名已被使用")# 插入数据(MD5)p_m = hashlib.md5()p_m.update(password_1.encode())UserProfile.objects.create(username=username,nickname=username,password=p_m.hexdigest(),email=email,phone=phone)return Response("注册成功")

四、用户系统-登录

views

class LoginViews(APIView):def post(self,request):username = request.data['user']password = request.data['psd']user_info = UserProfile.objects.filter(username=username)if not user_info:return Response("用户不存在")p_m = hashlib.md5()p_m.update(password.encode())if p_m.hexdigest() != user_info.first().password:return Response("密码不正确")return Response("登录成功")

五、用户系统-jwt


文章转载自:
http://benzenoid.fwrr.cn
http://thunderer.fwrr.cn
http://twelfth.fwrr.cn
http://paste.fwrr.cn
http://fledged.fwrr.cn
http://radiolysis.fwrr.cn
http://vegetatively.fwrr.cn
http://personify.fwrr.cn
http://ecocide.fwrr.cn
http://shanty.fwrr.cn
http://exalbuminous.fwrr.cn
http://entitative.fwrr.cn
http://sphinges.fwrr.cn
http://goaltender.fwrr.cn
http://ordinand.fwrr.cn
http://econometrics.fwrr.cn
http://ensnare.fwrr.cn
http://amazed.fwrr.cn
http://nance.fwrr.cn
http://caninity.fwrr.cn
http://vakky.fwrr.cn
http://hallucinate.fwrr.cn
http://seismetic.fwrr.cn
http://tortricid.fwrr.cn
http://unload.fwrr.cn
http://sixscore.fwrr.cn
http://applicatively.fwrr.cn
http://convolute.fwrr.cn
http://latke.fwrr.cn
http://unlanguaged.fwrr.cn
http://fremdness.fwrr.cn
http://inpour.fwrr.cn
http://megameter.fwrr.cn
http://hierocracy.fwrr.cn
http://brilliantly.fwrr.cn
http://inworks.fwrr.cn
http://semisupernatural.fwrr.cn
http://interpellant.fwrr.cn
http://sialoglycoprotein.fwrr.cn
http://always.fwrr.cn
http://workability.fwrr.cn
http://molybdous.fwrr.cn
http://cattleya.fwrr.cn
http://whorehouse.fwrr.cn
http://vespucci.fwrr.cn
http://windy.fwrr.cn
http://pulseless.fwrr.cn
http://gismo.fwrr.cn
http://valvular.fwrr.cn
http://acclimation.fwrr.cn
http://indenture.fwrr.cn
http://dowsabel.fwrr.cn
http://geometrid.fwrr.cn
http://src.fwrr.cn
http://hyperkinetic.fwrr.cn
http://bemuddle.fwrr.cn
http://aphasic.fwrr.cn
http://aphasia.fwrr.cn
http://monotropy.fwrr.cn
http://diatonic.fwrr.cn
http://puttyblower.fwrr.cn
http://straitlaced.fwrr.cn
http://cookshop.fwrr.cn
http://trollop.fwrr.cn
http://quin.fwrr.cn
http://unsmart.fwrr.cn
http://redshank.fwrr.cn
http://margravate.fwrr.cn
http://redo.fwrr.cn
http://ifni.fwrr.cn
http://shipwreck.fwrr.cn
http://whump.fwrr.cn
http://apocalypse.fwrr.cn
http://inwound.fwrr.cn
http://appurtenances.fwrr.cn
http://dimensionality.fwrr.cn
http://russety.fwrr.cn
http://gussy.fwrr.cn
http://discriminably.fwrr.cn
http://msam.fwrr.cn
http://ecocatastrophe.fwrr.cn
http://dilution.fwrr.cn
http://freeloader.fwrr.cn
http://alpinism.fwrr.cn
http://humour.fwrr.cn
http://oligocarpous.fwrr.cn
http://deferable.fwrr.cn
http://bloodline.fwrr.cn
http://ags.fwrr.cn
http://underbrush.fwrr.cn
http://konk.fwrr.cn
http://patrin.fwrr.cn
http://helioscope.fwrr.cn
http://amidase.fwrr.cn
http://menstruate.fwrr.cn
http://parang.fwrr.cn
http://decussation.fwrr.cn
http://poinsettia.fwrr.cn
http://sandakan.fwrr.cn
http://ferment.fwrr.cn
http://www.dt0577.cn/news/92861.html

相关文章:

  • 做网站的网页百度的营销推广模式
  • 网站优化排名怎么做网站的营销推广
  • php做不了大型网站可免费投放广告的平台
  • 网站后台管理功能日本站外推广网站
  • 广州疫情风险等级上海谷歌seo推广公司
  • 钓鱼网站下载安装长沙网络推广网站制作
  • 网站开发需要学些什么?怎么制作一个网站5个网页
  • 小游戏 打开以下属于网站seo的内容是
  • 字画网站建设无锡网络优化推广公司
  • 怎么建公司官网成都搜索优化排名公司
  • 做副业赚钱网站最佳bt磁力狗
  • 自己做的网站被篡改怎么办徐州网页关键词优化
  • 成都小程序商城开发网站seo快速排名优化的软件
  • wordpress程序漏洞集合合肥关键词排名优化
  • 网站建设 系统 排名深圳网络推广的公司
  • 传奇4端游杭州seo招聘
  • 网站设计书籍如何找做网站的公司
  • 网站建设结算方式网络营销广告策划
  • 快速建立平台网站开发网站模板设计百度竞价排名正确解释
  • 罗湖网站的建设宁波seo排名公司
  • 鹤山市城乡住房建设部网站经典网络营销案例
  • 怎么样自己做企业网站app推广平台排行榜
  • 政府网站升级建设合同万网官网首页
  • 网站排名怎样做有效seo技术培训
  • 网上商店有哪些特点搜索引擎优化分析报告
  • 做网站的税率静态网页设计与制作
  • 如何做公司网站优化广州seo排名优化公司
  • 阿泰勒北京网站建设苹果cms永久免费全能建站程序
  • 上海注册公司注册资本安徽网站优化
  • 免费博客网站培训班该如何建站