首先需要配置sqlite3
官方现在sqlite3压缩包,将其解压到某一文件夹中,然后在系统的环境变量中配置sqlite3,
由于在Django的项目文件夹目录下,有db.sqlite3文件,所以需要要访问该数据,需要在dos中键入下入命令,
sqlite3 db.sqlite3
进入数据库之后,即可使用sql语句进行访问
select * from dbname
SELECT name FROM sqlite_master
WHERE type='table'ORDER BY name;
select * from upload_user;
to insert a column in the models.py
password = CharField(max_length= 30)python manage.py shell
from django.db import connection
cursor = connection.cursor()
cursor.execute('alter table upload_user add column password varchar(30)')
python manage.py makemigrations
python manage.py migrate