How Django uses the command line to operate sqlite3

Two methods:

1. Use in the main directory of the Django project

python manage.py dbshell

Entering the command line of sqlite, you can directly use commands such as select to add, delete, modify, and query the database.

2. Use in the main directory of the Django project

python manage.py shell

Entering the python command line, you can use python syntax to operate the model of the django project, such as querying the Image with status=0:

Image.objects.filter(status=0)





Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325969071&siteId=291194637