Coder Social home page Coder Social logo

flaskapiadops_fe5x's Introduction

Flask-Api

N|Solid

Build Status

Aplicacion de Flask Restfull con las siguientes librerias:

Plugin README
Flask_SqlAlchemy https://flask-sqlalchemy.palletsprojects.com/en/2.x/
Flask_Restfull https://flask-restful.readthedocs.io/en/latest/
Flask_Marshmellow https://flask-marshmallow.readthedocs.io/en/latest/
Flask_cors https://flask-cors.corydolphin.com/en/2.0.1/

New Features!

  • Api Endpoints for:
    • Account
    • Marca
    • AccountxMarca

]

Installation

Es necesario installar Nginx (web server) Container, Gunicorn (WSGI HTTP Server), Flask (Python Web Service) y Supervisor (Control Process)

Install.

$ apt-get -y install python3-pip python3-dev nginx nano

Inciar instalando el virtualenv package using pip:

$ sudo pip install virtualenv

Ahora podemos crear un ambiente virutal, para alogar nuestro Flask project

$ virtualenv Apis

Despues de installar la apliacion con el ambiente virtual se puede activar escribiendo

$ source myprojectenv/bin/activate

Install Flask and Gunicorn

Instalaremos usando la instancia local con pip

$ pip install gunicorn flask

Para probar la aplicacion Flask se debe correr el siguiente comando

$ python Api.py

Testing Gunicorn

$ cd ~/Api
$ gunicorn --bind 0.0.0.0:5000 Api:app

Supervisor

Se debe configurar el archivo en /etc/supervisord.conf con lo siguiente

[program:TaskApi]
directory=/home/Centos/API/Flask/TaskApi
gunicorn --bind 0.0.0.0:5000 TaskApi:app
autostart=true
autorestart=true
stderr_logfile=/var/log/Apis/Apis.err.log
stdout_logfile=/var/log/Apis/Apis.out.log

Para activar la configuracion, se debe correr el siguente comando:

$ sudo supervisord -c /etc/supervisord.conf
$ sudo supervisorctl -c /etc/supervisord.conf

Con esto se iniciara el proceso. Para comprar si el estatus de todas las aplicaciones que estan siendo monitoreadas usar el siguiente comando

$ sudo supervisord status

Free Software, Hell Yeah!

FlaskApiAdops

Comandos para reiniciar el supervisor

$ sudo su 
$ systemctl reboot supervisord
$ systemctl start supervisord

Comandos para saber si esta activo el supervisor

$ sudo su 
$ systemctl status supervisord

flaskapiadops_fe5x's People

Contributors

duarteomg avatar neryop12 avatar trellixvulnteam 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.