简体   繁体   中英

django-admin to open a new project

I am using this command:

django-admin startproject Hello

to initiate a new project, but I am getting the following error

django-admin : The term 'django-admin' is not recognized as the name 
of a cmdlet, function, script file, or operable program. Check the   
spelling of the name, or if a path was included, verify that the     
path is correct and try again.
At line:1 char:1
+ django-admin startproject Hello
+ ~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (django-admin:String)  
   [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

just started with django and this is so frustrating

It seems that you dont have django installed. If you have already installed it, you should check if you are with your virtual enviroment (venv) activated. Check this doc: https://docs.python.org/pt-br/3/library/venv.html

Go to the project directory and try this:

python3 -m venv venv
source venv/bin/activate

Then:

django-admin --version **(to check if it is installed)**
django-admin startproject Hello

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM