Giter Site home page Giter Site logo

apply-api's Introduction

使用说明

环境配置

 pip install -r requirements.txt

修改配置文件

进入config目录,在该目录下打开config.y文件,修改项目所要的配置文件

# 配置数据库
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://用户名:密码@localhost/数据库?charset=utf8'

# 设置token过期时间
EXPIRATION = 60 * 60 * 2

项目运行

  • python run.py

服务器部署

# 安装 gunicorn
pip install gunicorn

# 运行下面命令
nohup gunicorn -w 4 -b 0.0.0.0:5000 run:app &

请求携带token

token需要放置在headers中,其它方式不可以,下面图片为使用postman测试时token的携带, 格式为

{
 "Authorization": "Bearer token(将获取到的token进行替换, Bearer为固定字段,注意二者之间需要空格)" 
}

headers中携带token

apply-api's People

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.