Django项目5 生成表结构

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

posted @ 2019-12-28 16:39  一只竹子  阅读(380)  评论(0编辑  收藏  举报