简体   繁体   中英

How solve django-admin is not recognized...?

I'm trying:

Django-admin startproject myweb

This is what i see:

'django-admin' is not recognized as the name of a cmdlet, function, script file, or operable


Even i added python27/Scripts to my pc environment variables but didn't work

首先,您需要先运行pip install django而不激活虚拟环境,如果您只想在虚拟环境中安装 django 那么您必须先激活它,然后只有在触发命令django-admin startproject myweb后才能将 django 安装到其中

Here is the solution to your problem: You can do this using virtualenv. step by step

  • py -m pip install --user virtualenv
  • py -m venv env
  • .\env\Scripts\activate
  • python -m pip install Django

check version:

  • python -m django --version

start project Command:

  • django-admin startproject mysite

start app Command:

  • python manage.py startapp myapp

now you can run project:

  • python manage.py runserver

http://127.0.0.1:8000/

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