Add the path "django-admin.py" to the command line in Windows 7

I am trying to add the django-admin.py path to the command line in Windows 7.

I tried to do it as follows:

 C:\>set django-admin.py = C:\Python27\Scripts\django-admin.py 

But cmd told me that:

 'django-admin.py' is not recognized as an internal or external command. 

So, how can I add the django-admin.py path to the command line in Windows 7?

I need this because later I do this:

  C:\Users\Michael\Desktop\mysite>django-admin.py startproject mysite 

Thanks.

+6
source share
2 answers

Try the following command.

 set path=%path%;c:\python27\scripts 

PATH installed only for cmd.exe, in which you execute the above command.

UPDATE

To permanently set PATH:

  • Right-click My Computer on the desktop.
  • Click Advanced System Settings on the left.
  • Click Environmental Variable .
  • Add or update the PATH variable:
    • If it does not exist, create it and set the value to C:\python27\scripts
    • If it exists, add ;C:\Python27\scripts to the existing value.
  • Reboot cmd.exe. (PATH will not change for cmd.exe already running)
+16
source

I saved anaconda (python) in the django folder and added the path using the setx command.

Even when I run python and what are the conda commands on the cmd command line, everything works fine. But the django-admin proj website command is not recognized

variable path snapshot -

C: \ ProgramData \ Oracle \ Java \ javapath; C: \ Program Files (x86) \ RSA SecurID Token Common; C: \ WINDOWS \ system32; C: \ WINDOWS; C: \ WINDOWS \ System32 \ Wbem; C: \ WINDOWS \ System32 \ WindowsPowerShell \ v1.0 \; C: \ Program Files (x86) \ ESCRIBA \ composer \ bin \; C: \ Program Files (x86) \ Sennheiser \ SoftphoneSDK \; C: \ Program Files \ Intel \ WiFi \ bin \; C: \ Windows \ System32; C: \ Program Files \ Common Files \ Intel \ WirelessCommon \; C: \ Program Files (x86) \ WebEx \ Productivity Tools; C: \ android-sdk \ tools \; C: \ android-sdk \ platform-tools \; D: \ Appium \ node_modules \ appium \ bin \; C: \ Program Files (x86) \ SafeCom \ SafeComPrintClient; C: \ Program Files \ Git \ cmd; C: \ Program Files \ Git \ mingw64 \ bin; C: \ Program Files \ Git \ usr \ bin; C: \ Program Files \ Java \ jdk1.8.0_144 \ bin; C: \ additional programs \ apache- ant -1.10.1 \ Bin; C: \ Users \ robhanda \ Django; C: \ Users \ robhanda \ Django \ Library \ MinGW-w64 \ Bin; C: \ Users \ robhanda \ Django \ Library \ USR \ Bin; C: \ Users \ robhanda \ Django \ Library \ Bin; C: \ Users \ robhanda \ Django \ Scripts; C: \ Users \ robhanda \ Django \ Scripts; C: \ Users \ robhanda \ Jangor>

-one
source

Source: https://habr.com/ru/post/1492542/


All Articles