Skip to main content
  1. 登录页面
  2. 数据库表结构初始化
  3. 数据内容导入和导出
  4. 数据页面展示
  5. 数据页面修改

创建虚拟环境并激活

python2 -m virtualenv venv
source venv/bin/activate

安装依赖

pip install -r requirements.txt

配置nginx

//安装nginx
yum install -y nginx

//添加配置
server {
        listen 6600;

        root /home/typhoon/;
        index index.html index.htm;

        # Make site accessible from http://localhost/
        server_name dev.wlafit.com;

        location / {
                add_header Access-Control-Allow-Origin * always;
                add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS' always;
                add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';

                if ($request_method = 'OPTIONS') {
                   return 204;
                }

                proxy_pass       http://127.0.0.1:6000;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_redirect off;
                proxy_set_header Host $host:6600;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

}

//nginx载入配置
nginx -s reload

配置mysql

//安装mysql

//创建表
create database typhoonw;
//创建用户
grant all privileges on typhoonw.* to 'typhoonw'@localhost identified by '1qaz@WSX3edc';

运行(开发环境)

export FLASK_APP=typhoonw
export FLASK_ENV=development
flask run --port 6000

安装supervisor

yum install -y epel-release
yum install -y supervisor
systemctl enable supervisord
systemctl start supervisord
systemctl status supervisord

/etc/supervisor/conf.d下添加typhoon.conf

[program:typhoon]
command     = /root/typhoon/venv/bin/gunicorn --bind 0.0.0.0:6000 --workers 1 --worker-class gevent typhoonw:create_app()
directory   = /root/typhoon
user        = root
startsecs   = 3

redirect_stderr         = true
stdout_logfile_maxbytes = 50MB
stdout_logfile_backups  = 10
stdout_logfile          = /root/typhoon/typhoon.log

相关路径请自行修改

创建日志文件夹

touch /root/typhoon/typhoon.log

5.4. supervisorctl reload 5.5 supervisorctl start parkingserver 5.6 supervisorctl status

初始化数据库

访问 localhost:6000/db
ok!

访问 localhost:6000/index
上传文件

链接:

/auth/login /auth/logout /data/add_item /data/index /data/landing_intro /data/parting_intro /data/query /data/total_data/string:type_str /db /hello /static/path:filename

Metadata

Release files for typhoonw 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for typhoonw 1.0.1
File Size Uploaded
typhoonw-1.0.1.tar.gz 665.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for typhoonw 1.0.1
File Interpreter ABI Platform
typhoonw-1.0.1-py2-none-any.whl Python 2 none any Details

Total release size: 1.3 MB

Release files / typhoonw-1.0.1.tar.gz

Download URL typhoonw-1.0.1.tar.gz
Size 665.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5faf7d1b47819744bc3a91d26fe1051a44586bd57008c3b06596edb332239973
BLAKE2b-256 checksum
How to use checksums
0ba68d6089151d88523135de117048c0ee21382df93ba26b447052defebfc1a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/2.7.15+

Release files / typhoonw-1.0.1-py2-none-any.whl

Download URL typhoonw-1.0.1-py2-none-any.whl
Size 667.5 kB
Tags Python 2
SHA-256 checksum
How to use checksums
877a395d78468b6a1df7b7653f3b16867c2645082cb2c4f101e3e3e43934027a
BLAKE2b-256 checksum
How to use checksums
35dd554268205369f26d21e5a28c442c2d249ea82094ab2d9a3b4f5dea74e47e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/2.7.15+

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page