Use PyCharm to add a Django project, pycharmdjango
I. Preparations (download of PyCharm and Python, skipped)
1. First download PyCharm
Address: http://www.jetbrains.com/pycharm/
2. Download Python
Address: https://www.python.org/getit/
Here I chose 3.6.4
2. Download Django
Address: https://www.djangoproject.com/download/
There are many methods. Here we only talk about one method. For other methods, refer to the above address.
1. win + r Enter cmd to open the Command Prompt window
2. Input
pip install Django==2.0.3
The version number is later. For the compatibility between the Django version and Python version, see
Django version |
Python versions |
1.8 |
2.7, 3.2 (until the end of 2016), 3.3, 3.4, 3.5 |
1.9, 1.10 |
2.7, 3.4, 3.5 |
1.11 |
2.7, 3.4, 3.5, 3.6 |
2.0 |
3.4, 3.5, 3.6 |
2.1 |
3.5, 3.6, 3.7 |
3. After the installation is successful, run the following command in the Command Prompt window:
Pip show django
You can find the downloaded directory.
4. Add Environment Variables
Add the directory of the binfile to the environment variable. For details, refer to my directory.
3. Use PyCharm to add a Django Project
In PyCharm Professional Edition, there are both Django options on the left side of the new project, but not in the Community version. You need to perform the following operations:
1. In the folder where you keep the project, right-click shift and choose here to open the command window
2. Enter the django-admin.py startproject mydjango
(Finally, your project name)
3. The project directory is generated under the current directory, as shown in figure
4. Use pycharm to open this project
5. Click Configure in the upper right corner.
6. Run the command after confirmation.
This is a success ~