如何将Django升级到2.0版本 [英] How to upgrade Django to 2.0 version
问题描述
我一直在努力升级我的djangoversión,我很高兴.
I've been traying to upgrade my django versión and I've coudnt.
xxx@yyyyyy:~# python
Python 2.7.12 (default, Nov 20 2017, 18:23:56)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.VERSION
(1, 11, 10, u'final', 0)
xxxx@yyyyyyy:~# pip install -U Django
The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/user/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: Django in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: pytz in /usr/local/lib/python2.7/dist-packages (from Django)
xxxx@yyyyyy:~# pip --no-cache-dir install -U Django
Requirement already up-to-date: Django in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: pytz in /usr/local/lib/python2.7/dist-packages (from Django)
如果enter code here
不是2.0,它应该是最新的Django版本,它是(1、11、10,u'final',0)
How it coud be up-to-date my django version if enter code here
it is not 2.0 it is (1, 11, 10, u'final', 0)
如果我执行ls -s来了解文件所有者:
And If I do an ls -s to know the files owners:
xxxx@yyyyyyy:~# ls -s /home/gechichure/.cache/pip
total 12
4 http 4 selfcheck.json 4 wheels
不是root或我的useradmin吗?!?!?!我不明白django的工作原理以及pip的工作原理:(
Not root or my useradmin ?!?!?! I do not understand how django it works and how pip it really works :(
我需要升级到2.0版本!
I need to upgrade to 2.0 versión !!
请提出任何建议
关于!!!
推荐答案
Django 2.0不适用于Python 2.7,因此您应该安装Python 3才能使用它.我建议制作一个virtualenv,使其安装没有问题.
Django 2.0 isn't available for Python 2.7, so you should install Python 3 to work with it. I recommend making a virtualenv to don't have problem with the instalation.
Follow this steps and you will success :) https://help.dreamhost.com/hc/en-us/articles/115000695551-Installing-and-using-Python-s-virtualenv-using-Python-3
这篇关于如何将Django升级到2.0版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!