Home  >  Article  >  Backend Development  >  Django tests whether the installation is successful

Django tests whether the installation is successful

高洛峰
高洛峰Original
2016-10-17 14:45:541540browse

After we install django, we should not rush to develop. We must first know whether our django is installed successfully. Note here: Some children's shoes report that the installation is unsuccessful. Most of the reasons are: permission issues, and the current user's permissions are insufficient. During the django installation process, files will be written in /usr/local/lib/, so before installation, make sure that the current user has permission to operate the lib directory. This ensures success.

Okay, let’s get down to business, let’s see if our django has been installed successfully. . .

1. Switch to any directory in Linux and enter the command:
shell# python

The displayed result is:

Python 2.7.2 (default, Jan 19 2012, 18:26:31)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

2. Then try to introduce the django module and enter the command:

>> > import django

There is no output and no error, indicating that the import should be successful

3. Check the version of django and enter the command:

>>>django.VERSION

Note: version is all in capital letters

Output results :

(1, 4, 3, 'final', 0)

means the final version of version 1.4.3

This also shows that the django we installed is successful!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn