fredliang44 / DuerOS-Python-Server

DuerOS skill deploy support.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DuerOS-Python-Server

DuerOS skill deploy support.

1.Intro

For full request documentation please visit DuerOS doc

2.Enviroment

python3, pip

3.Requirements

  • requests
  • flask
  • gunicorn
  • rsa
  • sqlite3
  • Flask_SQLAlchemy
  • Flask_PyMongo
  • mysql-connector-python-rf

4.Tree

├── README.md
├── app
│   ├── __init__.py
│   ├── tools
│   │   └── record.py
│   └── utils.py (handle requests)
├── config.py
├── database.db
├── defaults
│   └── settings.cfg (default config)
├── dueros.py
├── models
│   └── mysql
│       ├── activity.py (log activity)
│       └── init.py (init database)
├── requirements.txt
├── settings.cfg (copy from defaults/settings.cfg and edit with your config)
└── setup.py

5.Setup

Option 1: Using requirements.txt

git clone https://github.com/fredliang44/DuerOS-Python-Server.git
pip3 install -r requirements.txt
export FLASK_APP=$(pwd)/DuerOS-Python-Server/dueros.py

Option 2: Using setuptools

git clone https://github.com/fredliang44/DuerOS-Python-Server.git
python3 setup.py install
export FLASK_APP=$(pwd)/DuerOS-Python-Server/dueros.py

Please edit and uncomment your config indefaults/settings.cfg

Then move the file to root dir (inside dir DuerOS-Python-Server)

Support mongodb(recommend), sqlite, mysql as backend database(still testing)

6.Init db

If you are using sql database, please init before using new database.

flask init

7.Run

flask run

8.Gen Certs

For more information: DuerOS certs doc

flask gen_certs

Deploy

Option1: Using gunicorn cli

gunicorn -w 4 -b 0.0.0.0:8000 dueros:app

Option2: Using flask cli start gunicorn

log path log/

flask deploy

Maintainability

About

DuerOS skill deploy support.


Languages

Language:Python 100.0%