首页 > 其他 > 详细

Django项目5 生成表结构

时间:2019-12-28 17:49:11      阅读:103      评论:0      收藏:0      [点我收藏+]

1、表字段

category
id
name
create_time
update_time

article
id
title
desc
content
img
recommend
category_id
create_time
update_time

firend_url
id
name
url

site
title
desc
img

2、建表   在models中创建,设置好后执行创建命令

python manage.py makemigrations #生成表结构
python manage.py migrate #同步到数据库

3、使用Navicat连接查看创建的数据库

技术分享图片

技术分享图片

 

技术分享图片

 

 在pycharm中,db.sqlite3右键,复制path  D:\test\mjz\day13\dj_test\db.sqlite3

Django项目5 生成表结构

原文:https://www.cnblogs.com/lapt/p/12112209.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!