任務(wù) | 命令 |
創(chuàng)建新項(xiàng)目 | django-admin.py startproject project_name (注意: windows系統(tǒng)下請用django-admin startproject xxx) |
創(chuàng)建新應(yīng)用 | |
檢測模型變化,生成新的數(shù)據(jù)庫遷移文件 | |
同步數(shù)據(jù)庫與模型 | |
啟動服務(wù)器 | python manage.py runserver |
創(chuàng)建超級用戶 | python manage.py createsuperuser |
修改用戶密碼 | python manage.py changepassword username |
打開交互終端 | |
查看當(dāng)前版本 | python manage.py version |
命令 | 用途 |
python manage.py flush | 清空數(shù)據(jù)庫內(nèi)容,只留下空表 |
python manage.py test | 開始測試 |
python manage.py collectstatic | 搜集靜態(tài)文件 |
python manage.py createcachetable | 創(chuàng)建緩存表 |
python manage.py check | 檢測項(xiàng)目有沒有問題 |
python manage.py inspectdb [table] | 根據(jù)已有數(shù)據(jù)庫反向生成django模型。你可以選擇數(shù)據(jù)表名字 |
python manage.py makemessages | 搜集所有的messages,可以生成指定文件格式如xml文件,供后期翻譯 |
python manage.py sendemail [email] | 發(fā)送測試郵件 |
python manage.py showmigrations | 顯示所有數(shù)據(jù)庫遷移文件 |