Use Pip to delete/manage old Django versions

Source: Internet
Author: User
Tags install django

In the recent period of time, I was about to continue to pick up Django. The intermittent learning is equal to the abandonment of previous achievements, and the learning effect is not very good. In addition, there are relatively few tasks at work during this period of time, at noon today, the Django environment was rebuilt during the break time.

I installed django1.7 in ubuntu12.04 (Python: 2.7.3). I am going to learn how to read the Django official documentation and noticed that

This tutorial is written for Django 1.7 and Python 3.2 or later. If theDjango version doesn’t match, you can refer to the tutorial for your versionof Django by using the version switcher at the bottom right corner of thispage, or update Django to the newest version. If you are still using Python2.7, you will need to adjust the code samples slightly, as described incomments.

That is to say, the official document describes the usage of django1.7 and python3.2 or later. The related sample examples are also based on such a version.

As a result, we will not encounter any strange problems caused by the version later, or we will take the relevant versions adapted to official documents for learning. Therefore, you need to change the version.

This tutorial is written for Django 1.6 and Python 2.x. If the Djangoversion doesn’t match, you can refer to the tutorial for your version ofDjango by using the version switcher at the bottom right corner of this page,or update Django to the newest version. If you are using Python 3.x, be awarethat your code may need to differ from what is in the tutorial and you shouldcontinue using the tutorial only if you know what you are doing with Python3.x.

From the above official documents, django1.6 and python2.x are better used.

I don't know how you install Django. I directly decompress the tgz package, and then Python setup. PY install, and asked some friends who are playing well with Python that the Django version cannot be uninstalled through setup. it is best to use pip for version management.

[email protected]:~# sudo apt-get  install python-pip[email protected]:~/Django-1.7# pip install django==1.6.5Downloading/unpacking django==1.6.5  Downloading Django-1.6.5.tar.gz (6.6Mb): 6.6Mb downloaded  Running setup.py egg_info for package django        warning: no previously-included files matching ‘__pycache__‘ found under directory ‘*‘    warning: no previously-included files matching ‘*.py[co]‘ found under directory ‘*‘Installing collected packages: django  Found existing installation: Django 1.7    Uninstalling Django:      Successfully uninstalled Django  Running setup.py install for django    changing mode of build/scripts-2.7/django-admin.py from 644 to 755        warning: no previously-included files matching ‘__pycache__‘ found under directory ‘*‘    warning: no previously-included files matching ‘*.py[co]‘ found under directory ‘*‘    changing mode of /usr/local/bin/django-admin.py to 755Successfully installed djangoCleaning up...

In this way, the learning combination we use should satisfy the official document version requirements.


[email protected]:~# python -VPython 2.7.3[email protected]:~# python -c "import django; print(django.get_version())"1.6.5

====================================== Official documentation ======================================

If you previously installed Django using python setup.py install,uninstalling is as simple as deleting the django directory from your Pythonsite-packages. To find the directory you need to remove, you can run thefollowing at your shell prompt (not the interactive Python prompt):

According to the official documentation, if you install Python setup. py install, find the Django installation directory and delete it.

[email protected]:~# python -c "import sys; sys.path = sys.path[1:]; import django; print(django.__path__)"[‘/usr/local/lib/python2.7/dist-packages/django‘]


This article from the "dark magic king Teng cloud end" blog, please be sure to keep this source http://clovemfong.blog.51cto.com/3297559/1556957

Use Pip to delete/manage old Django versions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.