장고 sqlite3

정은경·2020년 7월 12일
0

🎸 Play the Django 

목록 보기
3/57

sqlite 데이터는 sqlite 브라우저를 통해 확인할 수 있다 :-)

1. python manage.py makemigrations

(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(play-with-orm⚡) » python manage.py makemigrations
Migrations for 'play_with_orm_app':
  play_with_orm_app/migrations/0001_initial.py
    - Create model Book
    - Create model Publisher
    - Create model Store
    - Add field publisher to book
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(play-with-orm⚡) » 
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(play-with-orm⚡) » sqlite3 db.sqlite3                                                               1 ↵
SQLite version 3.30.0 2019-10-04 15:03:17
Enter ".help" for usage hints.
sqlite> 
sqlite> .databaes
Error: unknown command or invalid arguments:  "databaes". Enter ".help" for help
sqlite> .databae
Error: unknown command or invalid arguments:  "databae". Enter ".help" for help
sqlite> 
sqlite> .table
sqlite> 
sqlite> .quit
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(play-with-orm⚡) »      

2. python manage.py migrate

(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(play-with-orm⚡) » python manage.py migrate                                                         1 ↵
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, play_with_orm_app, sessions
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying admin.0003_logentry_add_action_flag_choices... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying auth.0009_alter_user_last_name_max_length... OK
  Applying auth.0010_alter_group_name_max_length... OK
  Applying auth.0011_update_proxy_permissions... OK
  Applying play_with_orm_app.0001_initial... OK
  Applying sessions.0001_initial... OK
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(play-with-orm⚡) » 
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(play-with-orm⚡) » sqlite3 db.sqlite3                                                             127 ↵
SQLite version 3.30.0 2019-10-04 15:03:17
Enter ".help" for usage hints.
sqlite> 
sqlite> .database
main: /Users/marie/PycharmProjects/play-with-django/db.sqlite3
sqlite> 
sqlite> .table
auth_group                     django_content_type          
auth_group_permissions         django_migrations            
auth_permission                django_session               
auth_user                      play_with_orm_app_book       
auth_user_groups               play_with_orm_app_publisher  
auth_user_user_permissions     play_with_orm_app_store      
django_admin_log               play_with_orm_app_store_books
sqlite> 
sqlite> .quit
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(play-with-orm⚡) » 

Reference

profile
#의식의흐름 #순간순간 #생각의스냅샷

0개의 댓글