pipenv install django
pipenv shell
python manage.py startapp todo
python manage.py runserver
add 'todo' in installed_apps
After modifying models.py, you need migrate
python manage.py migrate
python manage.py shell
-
all objects
TodoItem.objects.all()
-
add objects
a = TodoItem(content = "a") a.save()
-
query
TodoItem.objects.get(id = 1)