Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Steps for Django to install and run on Linux

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "the steps of Django installation and operation on Linux". In the daily operation, I believe that many people have doubts about the steps of installation and operation of Django on Linux. The editor has consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "Django installation and operation steps on Linux". Next, please follow the editor to study!

1. Install Python3.6.2 in Linux

Download address: https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz

Install related dependency packages:

Yum-y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

Go to the unzipped directory and specify the appropriate installation directory:

. / configure-- prefix=/usr/local/python3

Start the installation:

Make & & make install

Set the appropriate environment variables:

Export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/app/mysql/bin:/usr/local/python3/bin

2. Install the specified version of Django software through pip3

Installation commands:

Pip3 install django==1.11.11

Check to see if the installation is successful

[root@ops-site bin] # django-admin-- version

1.11.11

3. Create the first Django site

Go to the appropriate directory and create a testsite directory:

Django-admin startproject testsite

Edit the settings.py file and set the appropriate access permissions

ALLOWED_HOSTS = ['*']

Start the site

Nohup python3 manage.py runserver 10.3.152.78 8000 &

Note: nohup runs in the background, 10.3.152.78 (the IP address of the server), and 8000 is the startup port

At this point, the study on "the steps to install and run Django on Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report