您好,登錄后才能下訂單哦!
沒有指定安裝django版本時,都會自動安裝最新版本。
而django從1.9版本后,相關命令已經變化。
如下為同步數據庫,
[root@Centos7-33 mydjango]# python3 manage.py makemigrations No changes detected [root@Centos7-33 mydjango]# python3 manage.py makemigrations app01 Migrations for 'app01': app01/migrations/0001_initial.py: - Create model Author - Create model Book - Create model Publisher - Create model user - Add field publisher to book [root@Centos7-33 mydjango]# python3 manage.py migrate Operations to perform: Apply all migrations: admin, app01, auth, contenttypes, sessions Running migrations: Applying app01.0001_initial... OK
查看數據庫數據:
[root@Centos7-33 mydjango]# mysql -uroot -p'Aaxxxxx' -U linweb -e 'show tables;' mysql: [Warning] Using a password on the command line interface can be insecure. +----------------------------+ | Tables_in_linweb | +----------------------------+ | app01_author | | app01_book | | app01_book_authors | | app01_publisher | | app01_user | | auth_group | | auth_group_permissions | | auth_permission | | auth_user | | auth_user_groups | | auth_user_user_permissions | | django_admin_log | | django_content_type | | django_migrations | | django_session | +----------------------------+
如圖:
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。