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: estmjzday13dj_testdb.sqlite3

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