Beispiel #1
0
from flask_migrate import MigrateCommand
from flask_script import Manager

from App import createApp

ab = createApp()

manager = Manager(ab)
manager.add_command('db', MigrateCommand)

if __name__ == '__main__':
    manager.run()
Beispiel #2
0
from flask import request, make_response, redirect, render_template, session, url_for, flash
from flask_bootstrap import Bootstrap
from flask_login import login_required
from App.forms import LoginForm, RegisterAccess, UpdatePhoneRequired
from App.firestoreService import getUsers, getUserRegisters, getUser, getPhones, getPhonesByAdmin, getRegister, setRegister, getCurrentRegister, getUserById, getPhoneId, updateRequired
import unittest, random

from App import createApp

app = createApp()

users = [
    'Comprar cafe', 'Enviar solicitud de compra', 'Entregar video a productor '
]


@app.cli.command()
def test():
    tests = unittest.TestLoader().discover('tests')
    unittest.TextTestRunner().run(tests)


@app.errorhandler(404)
def notFound(error):
    context = {
        "error": error,
        "number": "404",
        "title": "Not Found",
        "msg": "Lo Siento No Encontramos Lo Que Buscabas."
    }
    return render_template('error.html', **context)
from flask_script import Manager
from flask_migrate import MigrateCommand

from App import createApp

app = createApp('default')
manager = Manager(app)
manager.add_command('db', MigrateCommand)

if __name__ == '__main__':
    manager.run()