The command "django-admin.py startproject mysite" is not recognized

EDIT: I added the path to django-admin.py to my system path (C: \ Users \ me \ Downloads \ Django-1.5.1 \ django \ bin), but even after that, when I try to run django- admin.py startproject mysite, it asks me to select a file to open, and even when I select python.py, for some reason it opens chrome. I also tried python django-admin.py startproject mysite, but it says: "python: cannot open django-admin.py file: [Errno 2] There is no such file or directory." Any idea what is wrong?

I added python27 to the system path and when I open cmd and switch to the directory (C: \ Users \ me \ djcode) and then enter django-admin.py startproject mysite it says: "django-admin.py is not recognized as internal or external command, operating program or batch file. " When I try to enter the python django-admin.py startproject mysite command, it says: "python: cannot open the django-admin.py file: [Errno 2] There is no such file or directory"

Any idea why? The djangobook ( http://www.djangobook.com/en/2.0/chapter02.html ) says: "django-admin.py should be on your system path if you installed Django through the setup.py utility" .. what is it mean? How to add django-admin.py to my system path? I'm not sure where django-admin.py even exists.

+4
source share
7 answers

Locate the folder where django-admin.py is located. Then go to Control Panel> System> Advanced System Settings> Environment Variables. In user variables and / or system variables, search for an entry named PATH. Change it by adding the folder that you found earlier, use other entries as a guide, basically just make sure they are separated ; . If you have done all these steps, but are still in the same cmd prompt that you used before doing this, close it and open a new one so that it picks up your changes.

+8
source

For windows "django-admin" you need to create a project .exe file not a .py file and it is present in the following place: C: \ python27 \ Scripts so you need to add this location to your path.

+5
source

I have the same problem because I installed Django manually. Solution for solution:

If not, check out django-admin-script.py startproject mysite . If everything is ok, django installation is incorrect.

Sorry for my bad english, i'm french :)

+3
source

this work for me python 2.6.6 django 1.6.11 python C:\Python26\Scripts\django-admin.py startproject myapplication

+1
source

You need to install django. It seems you just downloaded it and expanded the archive.

After completing the above steps, you need to make sure that C:\Python27\Scripts is in your PATH ; otherwise the teams will not work.

To set PATH , go to Environment Variables from My Computer (right-click and then go to "Management", then to the left "Advanced Settings").

Finally, you need to run python django-admin.py , not django-admin.py

0
source

Try the following: django-admin startproject mysite

0
source

copy the Django-admin.exe file to the folder that you are using. the file can be found in python / python (version) / scripts. when you are done, the folder should appear in your file name

0
source

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


All Articles