Code Monkey home page Code Monkey logo

steam-key-python's Introduction

Steam-Key 的 Python 移植

安装 uWSGI

只支持 uWSGI 作为 web server, uWSGI 需要 OpenSSL 才能支持 WebSocket, 所以要从源码安装 uWSGI

sudo apt-get install build-essential python3-dev libssl-dev
pip3 install uwsgi -Iv --no-cache-dir --no-binary all 

调试

uwsgi --http :9090 --http-websockets --wsgi main:app --master --gevent \
    --set-placeholder SERVER_NAME=test --set-placeholder DEBUG=true --python-auto-reload 1

或者使用配置文件, 在配置中添加 DEBUG=true 标志

部署

使用 Nginx 作为前端反代, uwsgi 监听在 9090 端口

uwsgi 配置示例 config.ini

# 程序目录
base = /path_to/steam-key-python

# 如果使用 virtualenv, 需要设置其目录
home = %(base)/venv
pythonpath = %(base)

# wsgi 入口
module = main
callable = app

# 使用 uwsgi 协议
socket = 127.0.0.1:9090
http-websockets = true

# 并发数
gevent = 100
master = true

# 服务器名
SERVER_NAME = 测试

运行 uwsgi --ini config.ini

nginx 配置示例

location / {
   uwsgi_pass 127.0.0.1:9090;
   include uwsgi_params;
}

License

Apache License

steam-key-python's People

Contributors

ivicel avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.