您好,登錄后才能下訂單哦!
沒有指定安裝django版本時,都會自動安裝最新版本。
而django從1.9版本后,相關(guān)命令已經(jīng)變化。
如下為同步數(shù)據(jù)庫,
[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
查看數(shù)據(jù)庫數(shù)據(jù):
[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 | +----------------------------+
如圖:
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。