1、創(chuàng)建項(xiàng)目:
django-admin startproject? xxx
2、創(chuàng)建應(yīng)用:
python manage.py startapp? xxx(應(yīng)用的名字)
3、啟動(dòng)項(xiàng)目:
python manage.py runserver
4、生成遷移文件:
python manage.py makemigrations
5、遷移:
python manage.py migrate
6:安裝數(shù)據(jù)庫(kù)(詳情可見博主:http://www.lxweimin.com/p/8190dda4f0eb)
7、打開shell:
python manage.py shell
8:對(duì)象.save()? 相當(dāng)于insert into
類名.objects.all()? 相當(dāng)于select *