简体   繁体   English

Django-admin创建了django 1.8项目,但是我安装了django 1.11.2

[英]Django-admin creates a django 1.8 project, but I installed django 1.11.2

I'm a beginner in django.. 我是Django的初学者。

I am trying to build an application using django 1.11.2 and python 3.5.2, both are installed. 我正在尝试使用django 1.11.2和python 3.5.2构建应用程序,两者均已安装。 I have python 2.7 installed too. 我也安装了python 2.7。

I have executed this command: django-admin startproject Application1 to create a new application. 我已经执行了以下命令: django-admin startproject Application1创建一个新的应用程序。

The application runs, but the project is versioned Django 1.8, however when I run python -c "import django; print(django.get_version())" to find django version, it shows 1.11.2 该应用程序运行,但是该项目的版本为Django 1.8,但是当我运行python -c "import django; print(django.get_version())"来查找django版本时,它显示1.11.2

The command django-admin --version shows me 1.8.7 命令django-admin --version显示1.8.7

What's wrong? 怎么了?

Do I have two django installed versions? 我有两个django安装版本吗?

Should I upgrade django-admin? 我应该升级django-admin吗? How? 怎么样?

Please, help me.. I'm stuck. 请帮帮我..我被卡住了。

From my understanding, you have two django installed on your system: in your python2 environment and python3 environment. 据我了解,您在系统上安装了两个django:在python2环境和python3环境中。 So, what you have to do is to uninstall one of them so they won't be conflicted. 因此,您要做的就是卸载其中之一,以免它们冲突。 Since you want to use python3 as your environment, you should uninstall django in your python2 environment with the following command: 由于要使用python3作为环境,因此应使用以下命令在python2环境中卸载django:

pip uninstall django

If it says, "command not found" after you uninstall it, try to reinstall django with the following command 如果在卸载后显示“找不到命令”,请尝试使用以下命令重新安装django

pip3 install django

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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