django-api1 django(3)-database API django API (database API) interactive python shell에서 django API를 실행할 수 있다. python shell을 실행할 때 현재 django project의 DJANGO_SETTINS_MODULE 환경변수를 적용하기 위해서 manage.py를 통해 shell을 실행한다. $ poetry run python manage.py shell 이제 shell에서 database API 를 사용하여 이전 글에서 작성한 model들을 가지고 오브젝트를 만들거나 database에 쿼리를 실행할 수 있다. # 이전 글에서 작성한 Question, Choice 모델들을 import >>> from polls.models import Choice, Question >>> Que.. 2024. 3. 20. 이전 1 다음