Django installation configuration and operation in ubuntu

This article introduces the installation, configuration and operation of django in ubuntu. The main content includes its use cases, application skills, summary of basic knowledge points and matters needing attention. It has certain reference value, and friends who need it can refer to it.

1 Install django, make sure python is installed before installation, it is installed by default in ubuntu. We only need to install django, unzip the django compressed file, enter the unzipped folder, run, python setup.py install to install django into python.

2 To create a django project, first create a folder in any location, here is to create a work folder under the python user, then enter the work and run the command to create a django project.

 root @ubuntu118 :/home/python/work # django-admin.py startproject mysite

3 Start the django server

3.1 Start the django server with the default ip and port, the command is as follows

 root @ubuntu118 :/home/python/work/mysite # python manage.py runserver

Then go to the browser in ubuntu and enter http://localhost:8080 to view the corresponding page.

3.2 Set your own ip and port to start the django server, the command is as follows

 root @ubuntu118 :/home/python/work/mysite # python manage.py runserver 0.0.0.0:8000

Then run it on any computer…

The post django installation configuration and operation in ubuntu first appeared on Lenix Blog .

This article is reprinted from https://blog.p2hp.com/archives/9672
This site is for inclusion only, and the copyright belongs to the original author.