django Beginners are using django-admin When creating a project, it is prone to errors that cannot be created , This is because many online tutorials use django-admin.py Project created , If nothing else , If you enter the same command, you will find that the project has not been created , It was opened django-admin.py This file .
django-admin It's a management tool
django-admin.py It's a python file
Enter at the command line django-admin In essence, the implementation is django-admin.exe, you 're right , It's an executable , But he is not site-packages\django Under the path , Not surprisingly, you can python\Scripts See him down the path (pip The installation is like this , Other installation methods are unknown ).
1. function django-admin startproject h1
2. since django-admin.py It's a python file , To create a project with him, you must run him , So another way to create django The project approach is to run python ......\site-packages\django\bin\django-admin.py startproject h2
The main reason for this problem is that the environment variables are not understood , Before installing java、python When waiting for the environment, they are mindless and follow the tutorial , I also have a little knowledge of environment variables . The importance of Foundation ....
author : Empty bad uncle Blog