1.安装Django
pip install django
2.新建项目
django-admin startproject mysite
报错信息:zsh: command not found: django-admin
需要创建软连接
sudo ln -s /Library/Frameworks/Python.framework/Versions/3.6/bin/django-admin /usr/local/bin/django-admin
再次创建项目目录
django-admin startproject mysite
3.启动Django服务
python manage.py runserver 0:9000 //浏览器访问localhost:9000
如下报错,因为版本为python3
4.创建app
python3 manage.py startapp user