创建临时项目data_crud
D:\sort\tmp>django-admin.py startproject data_crud
进入data_crud目录,创建app crud_app
D:\sort\tmp>cd data_crud
D:\sort\tmp\data_crud>python manage.py startapp crud_app
使用PyCharm打开项目data_crud
本教程所参考的数据模型请查看链接,该数据模型可以用于博客应用
修改data_crud/settings.py添加‘crud_app’
更新数据库
D:\sort\tmp\data_crud>python manage.py makemigrations
D:\sort\tmp\data_crud>python manage.py migrate
进入交互式模式
D:\sort\tmp\data_crud>python manage.py shell
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (
Intel)]
……
In [1]: from crud_app.models import Blog