GithubHelp home page GithubHelp logo

flaskpastillas's Introduction

Instalación

Para realizar la instalación necesitamos crear un entorno e instalar todas las bibliotecas para flask.

mkdir flaskpastillas
cd flaskpastillas
mkvirtualenv flaskpastillas
workon flaskpastillas
pip install -r requirements.txt

Es una muy buena idea usar ipython adentro del virtualenv. Sobretodo si estás depurando cosas o investigando.

Este link explica cómo hacerlo:

Ejecutar la aplicación en modo desarrollo

Primero hay que entrar en el entorno, y luego lanzar del servidor de prueba:

workon flaskpastillas
cd flaskpastillas
python app.py

Iniciar Redis y Celery

El sistema de importación de registros en el sistema se realizó usando Celery, así que si quieres usar esa funcionalidad hay unos pasos mas...

Estos pasos solamente son necesarios si se quiere iniciar la importación masiva desde una planilla excel, no es necesario para el uso normal de la aplicación.

Primero es conveniente iniciar Redis (backend de datos/comunicación), y luego iniciar Celery desde el entorno virtual de python.

Abre un terminal y ejecuta el servidor de redis:

redis-server

Luego, desde otro terminal podrías ingresar en el entorno virtual y lanzar Celery:

workon flaskpastillas
cd flaskpastillas
python manage.py celeryd

Ejecutar la aplicación en modo producción

Hay que ingresar en el entorno y luego abrir greenunicorn:

workon flaskpastillas
~/.virtualenvs/flaskpastillas/bin/gunicorn app:app -b 0.0.0.0:8000

Ten en cuenta que existe un parámetro -D para correr este comando como daemon, y luego hay otro comando llamado gunicorn-console para monitorizar los procesos.

Por ejemplo:

~/.virtualenvs/flaskpastillas/bin/gunicorn app:app -b 0.0.0.0:8000
~/.virtualenvs/flaskpastillas/bin/gunicorn-console

flaskpastillas's People

Contributors

hugoruscitti avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.