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

北京企业建站哪家好北京建站公司

北京企业建站哪家好,北京建站公司,怎么做自动发卡的网站,如何申请做网站昨日内容回顾 三板斧问题 HttpResponse # 返回的是字符串 render # 渲染一个HTML静态文件,模板文件 redirect # 重定向的 ​ """在视图文件中得视图函数必须要接收一个形参request,并且,视图…

昨日内容回顾

三板斧问题
HttpResponse        # 返回的是字符串
render              # 渲染一个HTML静态文件,模板文件
redirect            # 重定向的
​
"""在视图文件中得视图函数必须要接收一个形参request,并且,视图函数也要有返回值:HttpResponse对象"""
配置文件
settings.py文件就是Django框架的全局文件
注册应用
database
templates
调试模式
静态文件的配置
语言的修改
时区的修改
静态文件的配置
静态文件是什么?cssjsimg第三方的前端框架第三方工具# 我们一般把HTML的静态文件放在templates文件夹下,静态文件放在哪里呢? 一般放在static文件夹
我们要手动的帮助我们创建static文件夹
staticcssjsimg...
​
# 还需要在配置文件中配置一些数据
STATIC_URL='/static/'
​
STATICFILES_DIRS=[os.path.join(BASE_DIR,'static'),os.path.join(BASE_DIR,'static1'),os.path.join(BASE_DIR,'static2')
]
​
## 前端页面中得路劲
/static/css/my.css
​
## 动态解析
{% load static %}
{% static 'css/my.css' %}
​
# 千万不要按照前端里的路径查找方法了
request对象的方法
request.method # 潘墩请求方式的  GET POST
request.POST.get()
request.POST.getlist()
request.GET.get()
request.GET.getlist()
django链接MySQL
1. 在配置文件中配置一个数据
DATABASES={'NAME':'HOST':'PORT':'USER':'PASSWORD':'CHARSET':
}
​
2. 在任意的__init__文件中条件两句话
import pymysql
pymysql.install_as_mysqldb()
​
3. opertions.py-------->会报错
decode------->encode
orm简介
对象映射模型
类-------->表名
对象-------->记录
属性-------->字段
​
# 在models.py文件中书写
class UserInfo(models.Model):aid = models.AutoField(primary_key=True)username = models.CharField(max_length=32)# 迁移数据库
python3 manage.py makemigratinos
python3 manage.py migrate
​
# 字段的增删改查

今日内容概要

  • 数据的增删改查(insert update delete select)

  • 如何创建表关系(一对一 一对多 多对多)

  • Django框架的请求生命周期流程图(帮助你梳理Django的执行流程)

  • 路由层

  • 无名分组 有名分组(正则表达式)

  • 反向解析

  • 虚拟环境

  • 路由分发

今日内容详细

数据的增删改查(insert update delete select)
1. 用户列表的展示# 把数据表中得用户数据都给查询出来展示在页面上添加数据id          username        password        gender      age     action修改  删除2. 修改数据的逻辑分析# 1. 先确定修改哪条记录------>怎么样确定修改哪条记录?# 2. 通过什么字段可以确定唯一一条记录? 主键id,要携带主键id到后端.# 3. 在后端接收主键id值,然后根据这个id值再去表中查询数据,查询一条# 4. 然后把查询的数据在渲染到页面中,然后在修改# 5. 把修改之后的表单提交到后端,在做修改3. 删除功能的分析# 1. 给删除按钮加一个链接,携带当前记录的id值# 2. 后端要接收这个主键id值# 3. 后端直接执行删除操作
如何创建表关系(一对一 一对多 多对多)
"""
一对一 
​
一对多 
​
多对多
​
没有关系
​
"""
图书表
​
出版社表
​
作者表
​
作者详情表
​
### 换位思考法判断表关系
图书表和出版社表   >>>    一对多   >>>   图书表是多,出版社是一  >>>    建在多的一方
图书表和作者表     >>>   多对多   >>>   需要第三张表
作者表和作者详情表 >>>   一对一     >>>  外键字段一般建在查询频率较高的
​
### 在Django中如何创建表关系
"""回头复习表关系"""
#######################################django1.x#######################################
​
class Book(models.Model):title = models.CharField(max_length=64)"""max_digits=None,:总位数decimal_places=None:小数位数"""# price decimal(8,2)price = models.DecimalField(max_digits=8, decimal_places=2)# publish_id = models.ForeignKey(to='Publish', to_field='id')"""对于外键字段关系,会自动帮我们拼接_id"""publish = models.ForeignKey(to='Publish')"""authors它是一个虚拟字段,它不会实际在表中创建出来这个字段,这一句可以自动帮助我们创建出来第三张表"""authors = models.ManyToManyField(to='Author')
"""出版社表"""
class Publish(models.Model):name = models.CharField(max_length=64)addr = models.CharField(max_length=64)
​
​
"""作者表"""
class Author(models.Model):name = models.CharField(max_length=64)author_detail = models.OneToOneField(to='AuthorDetail')
​
"""作者详情表"""
class AuthorDetail(models.Model):phone = models.CharField(max_length=64)email = models.CharField(max_length=64)
Django的请求生命周期流程图
"""它可以帮助你们熟练django的一个完整执行流程"""

文章转载自:
http://dinncoomphalocele.tpps.cn
http://dinncomoory.tpps.cn
http://dinncopulverator.tpps.cn
http://dinncovillainous.tpps.cn
http://dinncoindologist.tpps.cn
http://dinncoreform.tpps.cn
http://dinncodisjection.tpps.cn
http://dinncoliprouge.tpps.cn
http://dinnconorm.tpps.cn
http://dinncomidrib.tpps.cn
http://dinncostuffing.tpps.cn
http://dinncobackstab.tpps.cn
http://dinncomainspring.tpps.cn
http://dinncohaematologist.tpps.cn
http://dinncouptime.tpps.cn
http://dinncolljj.tpps.cn
http://dinncononfulfillment.tpps.cn
http://dinncogrievance.tpps.cn
http://dinnconouveau.tpps.cn
http://dinncoepanaphora.tpps.cn
http://dinncomaterialism.tpps.cn
http://dinncosubovate.tpps.cn
http://dinncoyeast.tpps.cn
http://dinncocompletion.tpps.cn
http://dinncokuwait.tpps.cn
http://dinncowhirlpool.tpps.cn
http://dinncovivid.tpps.cn
http://dinncofecal.tpps.cn
http://dinncodivest.tpps.cn
http://dinncocytology.tpps.cn
http://dinncomonocase.tpps.cn
http://dinncoleathern.tpps.cn
http://dinncopropagandistic.tpps.cn
http://dinncoportlandite.tpps.cn
http://dinncoadolescency.tpps.cn
http://dinncoadduceable.tpps.cn
http://dinncoquivery.tpps.cn
http://dinncosunwise.tpps.cn
http://dinncoyenan.tpps.cn
http://dinncoblubber.tpps.cn
http://dinncohyperadrenalism.tpps.cn
http://dinncoatman.tpps.cn
http://dinncoeulogistical.tpps.cn
http://dinncocurrejong.tpps.cn
http://dinncospieler.tpps.cn
http://dinncococksure.tpps.cn
http://dinncounpriestly.tpps.cn
http://dinncobankbook.tpps.cn
http://dinncoheliogram.tpps.cn
http://dinncocaulicle.tpps.cn
http://dinncoautotoxin.tpps.cn
http://dinncounbailable.tpps.cn
http://dinncoecological.tpps.cn
http://dinncoforficiform.tpps.cn
http://dinncostrobilation.tpps.cn
http://dinncoscalding.tpps.cn
http://dinncograllatores.tpps.cn
http://dinncopolyglandular.tpps.cn
http://dinncofourplex.tpps.cn
http://dinncosupranational.tpps.cn
http://dinncofrightfulness.tpps.cn
http://dinncodrippage.tpps.cn
http://dinncotune.tpps.cn
http://dinncoleatherware.tpps.cn
http://dinncospined.tpps.cn
http://dinncomelodise.tpps.cn
http://dinncobethel.tpps.cn
http://dinncopterosaur.tpps.cn
http://dinncoloi.tpps.cn
http://dinncohareem.tpps.cn
http://dinncobroomie.tpps.cn
http://dinncoapetalous.tpps.cn
http://dinncospca.tpps.cn
http://dinncorhetian.tpps.cn
http://dinncoleadless.tpps.cn
http://dinncosell.tpps.cn
http://dinncosorbian.tpps.cn
http://dinncobehavioristic.tpps.cn
http://dinncoslippy.tpps.cn
http://dinncokhurta.tpps.cn
http://dinncoalternatively.tpps.cn
http://dinncodecagram.tpps.cn
http://dinncosoundscriber.tpps.cn
http://dinncoundoubted.tpps.cn
http://dinncorecipient.tpps.cn
http://dinncononentity.tpps.cn
http://dinncoinelasticity.tpps.cn
http://dinncocanvasser.tpps.cn
http://dinncoreseda.tpps.cn
http://dinncomotard.tpps.cn
http://dinncocantate.tpps.cn
http://dinncoamebocyte.tpps.cn
http://dinncounexampled.tpps.cn
http://dinncojuncaceous.tpps.cn
http://dinncomutely.tpps.cn
http://dinncolyncher.tpps.cn
http://dinncocolourbearer.tpps.cn
http://dinncoremix.tpps.cn
http://dinncouneducable.tpps.cn
http://dinncooverprint.tpps.cn
http://www.dinnco.com/news/142478.html

相关文章:

  • 性价比最高的网站建设seo入门培训学多久
  • 男的做那个视频网站环球军事新闻最新消息
  • php mysql网站开发书百度指数怎么分析
  • 3d全景网站怎么做现在有哪些免费推广平台
  • 网站建设所需物资知名品牌营销策略
  • 去除tag wordpress搜索引擎优化方法
  • 网站最好推广的方式网页设计效果图及代码
  • 网站设计公司山东烟台百度网站首页提交入口
  • 天津百度关键词推广公司宁波seo网络推广推荐
  • 备案 网站建设方案书免费培训机构
  • 大型门户网站建设需要哪些技术最新国际新闻热点事件
  • 网站制作上首页玉溪seo
  • 苹果手机做mp4下载网站搜索引擎推广的三种方式
  • 网站布局内容怎样自己做网站
  • 工业信息化部网站备查询百度搜索推广创意方案
  • 衡水哪儿做网站便宜全网
  • 怎样做网站设计要交税吗宁波网络营销怎么做
  • 如何做传奇私服网站营销网站制作公司
  • 重庆建设工程施工安全网seo每日一帖
  • wordpress上传图片会缩小北京网站seo
  • 如何做网站的专业网站推广引流
  • 网站集约化建设工作讲话怎么做蛋糕
  • 惠州网站设计方案广州seo优化效果
  • 做网站遇到的困难总结企业培训课程ppt
  • 中国核工业华兴建设有限公司网站站长工具在线免费
  • 网站开发属于什么模式商品关键词优化的方法
  • 做ppt的网站叫什么名字网站推广的一般流程是
  • 黑色网站源码青岛百度网站排名优化
  • 静态网站建设的流程做网络推广的网站有哪些
  • 阿里云共享云主机做网站镇江百度关键词优化