pip install djangodjango-admin startproject mysitetreedjango-admin startapp mysite_userdjango-admin startapp mysite_blogtreecd mysitelspython3 manage.py -helppython3 manage.py runserver #启动服务python3 manage.py runserver 8080 #更改端口python3 manage.py flush #清空数据库python3 manage.py createsuperuser #创建一个超级用户python3 manage.py changepssword user #修改用户密码python3 manage.py shell #默认会进入ipythonpython3 manage.py startapp TestModel #创建APP,定义模型python3 manage.py dbshell #进入数据库python3 manage.py makemigrations TestModel #让 Django 知道我们在我们的模型有一些变更python3 manage.py migrate #创建表结构vim settings.py #配置文件