软件版本:PyCharm Community Edition 2021.3.3
python版本:Python 3.9.0
![](https://img-blog.csdnimg.cn/img_convert/7af3213b572093ef84b6b04fb11702a7.png)
用PyCharm Community Edition 2021.3.3
![](https://img-blog.csdnimg.cn/img_convert/b38e87427965c56df7f0e27d6be31dc5.png)
新建一个项目
![](https://img-blog.csdnimg.cn/img_convert/368a88cbce78a8112631738246b9f342.png)
然后打开文件-设置
![](https://img-blog.csdnimg.cn/img_convert/a1e1efc1d5d7af9370eeba2a30e72089.png)
点击项目:xxx-Python解析器
1. 点击“+”
2. 查找django
3. 安装Django
![](https://img-blog.csdnimg.cn/img_convert/3a433d7fde5a99af705ebc392758e581.png)
安装完成
![](https://img-blog.csdnimg.cn/img_convert/4d11c6fc1d78bcf449cfab909efa5c42.png)
然后我看了一下python3.9.0 应该对应的是django2.2
所以重新下载django
pip install django==2.2
![](https://img-blog.csdnimg.cn/img_convert/e37e423149b5678a4b3067fd83ee66e2.png)
接下来:文件-设置-工具-终端
![](https://img-blog.csdnimg.cn/img_convert/2dd224fc2cb1f6db5f65e9a7adb4545a.png)
打开:视图-工具窗口-终端
![](https://img-blog.csdnimg.cn/img_convert/553b846427f396c6789779171f2991b8.png)
然后输入命令:django-admin startproject djangoproject
![](https://img-blog.csdnimg.cn/img_convert/22a5b37ae045b29b5f7df5b099de040f.png)
创建完成
![](https://img-blog.csdnimg.cn/img_convert/4d2046fbe716999f39fc9b15e6e6bcd8.png)
接下来
1输入:cd djangoproject
2输入:python manage.py runserver
![](https://img-blog.csdnimg.cn/img_convert/d25c8f539d8f8ed08947929c990a4535.png)
![](https://img-blog.csdnimg.cn/img_convert/4b2edcd4aa5508a8afa0cec044a6c853.png)
点击打开http://127.0.0.1:8000/ 出现这个界面,表示Django项目已经搭建成功
![](https://img-blog.csdnimg.cn/img_convert/9a15dcefa5fc00d737207d5fccdebc72.png)
总结:一定要注意python版本来下载对应的django版本