First, Django introduction
1, Django installation . Django installs and installs the other modules, we find the script directory of the Python installation directory, and then execute the command: PIP3 install Django. After the installation is complete, you will see the following Django-related files in the script directory
After executing this command, add the script directory to the environment variables of the system, and we can use the Django command to execute it in any directory on the system. Let's create a new Django project.
Once created, let's look at the directory structure of the Django Project first.
Now let's start the project by using the command python manage.py runserver 127.0.0.1:8001. It is important to note that Python needs to configure the environment variables, and we want to go into the root directory of our project to execute, the following is the start of success, this time we visit http://127.0.0.1:8001/can visit our website,
It's a lot easier to install Django in Pycharm, and take a look at the figure 4 steps to solve.
OK, after installing, we use Pycharm to create a Django project.
After the creation is complete, we see that the project's directory structure is:
And we created in the command line exactly the same, just a templates directory, this is Pycharm help us to create, forget it, and then we configure the launch of the information, click the Pycharm Launch button to complete the site launch.
29. Python's web Framework Django Primer