Giter Site home page Giter Site logo

zyylele123 / flask-restful-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tyler2350/flask-restful-demo

0.0 1.0 0.0 36.28 MB

flask简单权限系统

Python 96.84% Mako 0.03% C++ 0.55% C 0.76% Fortran 0.03% Smarty 0.01% HTML 1.68% JavaScript 0.02% CSS 0.02% Tcl 0.07% PowerShell 0.01% Batchfile 0.01%

flask-restful-demo's Introduction

flask权限系统,前后台分离模式开发 后端: 1、采用restful接口方式开发; 2、使用jwt框架做token登录校验,此处没有做登录过去校验,实际开发中可以将过期校验逻辑存入redis中,如果访问了不大,也可以直接存入数据库中,具体逻辑请参见utils下面的auth_helper.py; 3、采用flask+sqlalchemy开发; 4、发布使用uwsgi,详细配置见跟目录下的uwsgi.ini配置; 5、数据库为了测试方便,使用的是sqlite,见db/ats.db 前端: 1、vue全家桶+element-ui; 2、通过axios方式与后台交互; 3、前端发布采用nginx;

运行项目: 1、安装python3.6.4; 2、在pycharm中选择venv下的python.exe(也可通过pip install -r requirements.txt安装相关依赖); 3、根目录下的dist是前端vue编译后的项目,但这样运行每次请求都会进入404,所以生成环境请分开部署;

启动方式一 /home/flask_permission_system>uwsgi --http :443 --file run.py --callable app --master --processes 24 --threads 12 > out.file 2>&1 & 启动方式二 /home/flask_permission_system>uwsgi --ini uwsgi.ini 重载(一般修改参数,或者修改py文件经常用到) /home/flask_permission_system>uwsgi --reload uwsgi.pid 重启(一般系统环境变化会用到) /home/flask_permission_system>uwsgi --stop uwsgi.pid /home/flask_permission_system>netstat -anp | grep 80 /home/flask_permission_system>kill -9 进程号

如果部署多个项目,可以使用虚拟环境 pip install virtualenv pip install virtualenvwrapper

flask-restful-demo's People

Watchers

James Cloos 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.