파이썬 장고 `dbshell`
dbshell 는 Django 응용 프로그램에서 작업할 때 SQL 데이터베이스 디버깅에 매우 유용한 도구입니다.SQL 쉘을 대화식으로 실행하려면 다음을 수행하십시오.
python manage.py dbshell
넌 봐야 해:
SQLite version 3.32.3 2020-06-18 14:16:19
Enter ".help" for usage hints.
sqlite> 
유용한 Django
sqlite 명령:.help
.tables
SQL 명령의 예:
SELECT * FROM django_migrations;
테이블의 열(헤더) 이름을 보려면 다음을 수행하십시오.
.header on
.mode column
pragma table_info('django_migrations');
출력 예:
sqlite> pragma table_info('django_migrations');
cid         name        type        notnull     dflt_value  pk        
----------  ----------  ----------  ----------  ----------  ----------
0           id          integer     1                       1         
1           app         varchar(25  1                       0         
2           name        varchar(25  1                       0         
3           applied     datetime    1                       0      
this StackOverflow 답변도 참조하십시오.
Reference
이 문제에 관하여(파이썬 장고 `dbshell`), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/mikolajbuchwald/python-django-dbshell-4dl3텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)