django2 Quick Installation guide Shared

  • 2020-06-23 00:54:23
  • OfStack

1. Install

As an Python Web framework, Django requires Python support. See what VERSIONS of Python can I use with Django? Get the details. Python contains a lightweight database named SQLite, so you don't need to set up the database.

Please pass https: / / www. python. org/downloads/or the operating system's package manager to obtain the latest version of Python.

You can verify that Python is installed from shell by using Python; You should see the following:


Python 3.4.x
[GCC 4.x] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

2. Create a database

If you want to use a large database engine like PostgreSQL, MySQL, or Oracle, just do this step. To install such a database, consult the database installation information

3. Delete the old version of Django

If you are upgrading to the previous version of Django, you will need to uninstall the old version of Django before installing the new version

If you are using the PIP or easy_install installation, PIP or easy_install will automatically handle the old version, so you don't need to do it yourself.

If you have used Django before, uninstalling is as simple as removing directory 1 from Python. To find the directory you want to remove, run the following command at the shell prompt instead of the interactive Python prompt:


$ python -c  " import django; print ( django .__ path__ )" 

4. Install

You have 3 simple options to install Django:

Install the official version. This is the best approach for most users.

Install version of Django from the operating system distribution.

Install the latest development version. This option is available for those who want the latest and greatest features. The development version of Django may have more errors, and reporting these errors will help Django's development. In addition, the release 3 version of the package is unlikely to be compatible with the development version compared to the latest stable version

5. Install the official version

(This article only covers the official version installation)

This is the recommended way to install Django.

PIP installation.


# pip install Django

6. Check the installation

Try to pour into django in Python. If you successfully import it, you have successfully installed it.


$ python3
Python 3.6.4 (default, Dec 25 2017, 14:57:46) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>>

Related articles: