1. Terminal create project

After creating the virtual environment in the previous step, in the virtual environment, go to the object file and create the project

1. PWD --User 2. ls --yongjuanwang 3. CD yongjuanwang # enter this folder 4. ls -- virtual environment 5. CD virtual environment 6. mkdir renran 7. CD renran 8. django-admin startproject renranapiCopy the code

Pycharm Configure the environment

1. Pycharm opens the project: Pychram –> Preference –> Configure as shown below

2. Set parameters for manage.py

If the child runs the manage.py file, only the following parameters appear:

You need to configure its parameters

Configuration is as follows

Configure settings.py

ALLOW_HOSTS = [‘ 0.0.0.0 ‘]

At this point open the link http://0.0.0.0:8000/

The following display appears;

The basic configuration of the project is complete! Tip:

  • To use the virtual environment you have created in PyCharm, you must set the Python interpreter in PyCharm to Python in the virtual environment.