Project deployment of seed search website based on python

This lecture will explain the deployment process of seed search website in detail.

Website presentation:

Source address:

Project deployment process

System requirement: ubuntu 16.04 (or above)

To build and configure the environment, you must strictly follow the following steps to install and deploy! You can consult if you have any questions (weixin: java2048)

Installation part

Install nginx

sudo apt install nginx

Install python3 and pip3

sudo apt install python3
sudo apt install python3-pip

Installation dependency

pip3 install uwsgi
pip3 install django
pip3 install pymysql
pip3 install django-ratelimit  

Install mysql

sudo apt install mysql-server

Configuration part

Configure mysql(/etc/mysql/my.cnf)


mysql start

/etc/init.d/mysql start

Create database

# Enter database
mysql -u root -p
# Create database
create database bt;
# Sign out

Pull the code to / var/www /

sudo git clone

To configure, you need to configure two things: database and domain name.

Configuration database

    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'bt',      # Database created
        'USER': 'root',
        'PASSWORD': 'xxx', # Your mysql password

Domain name configuration (write your own domain name to allowed hosts)


Import table structure

python3 makemigrations
python3 migrate 

Create superuser

python3 createsuperuser

Create log file

In the / var/www/bt / directory, create the uwsgi.log file and set the permission to 766

sudo touch uwsgi.log
sudo chmod 766 uwsgi.log

Run configuration (configuration at bt/uwsgi.ini)

uwsgi --ini uwsgi.ini

Configure nginx, create bt.conf under / etc / nginx / sites enabled, write:

upstream bt {
server {
        listen 80;
        server_name; # Your domain name 

        location /static/ {
           alias /var/www/bt/static/;

        location / {
             include         uwsgi_params;
            uwsgi_pass      bt;


Run nginx

sudo service nginx start

be accomplished!

Tags: Web Server MySQL sudo Database Nginx

Posted on Mon, 02 Dec 2019 13:42:01 -0500 by whir