Exemplo n.º 1
0
    def setUp(self):
        # create app with a testing database
        budget.app = budget.create_app(db='sqlite:///:memory:')
        self.app = budget.app.test_client()

        # cleanup
        #self.app.get('/test/wipe-tables')

        # setup our test user
        self.app.get('/test/create-user/admin')
Exemplo n.º 2
0
from cherrypy import wsgiserver
import budget

app = budget.create_app(db='sqlite:////var/www/html/python/flask/budget/db/database.sqlite3')
wsgi_apps = [('/', app)]
server = wsgiserver.CherryPyWSGIServer(('0.0.0.0', 8070), wsgi_apps, request_queue_size=500, server_name='localhost')

if __name__ == '__main__':
    try:
        server.start()
    except KeyboardInterrupt:
        server.stop()
Exemplo n.º 3
0
from cherrypy import wsgiserver
import budget

app = budget.create_app(
    db='sqlite:////var/www/html/python/flask/budget/db/database.sqlite3')
wsgi_apps = [('/', app)]
server = wsgiserver.CherryPyWSGIServer(('0.0.0.0', 8070),
                                       wsgi_apps,
                                       request_queue_size=500,
                                       server_name='localhost')

if __name__ == '__main__':
    try:
        server.start()
    except KeyboardInterrupt:
        server.stop()
Exemplo n.º 4
0
from budget import create_app

app = create_app()

if __name__ == "__main__":
    import sys
    try:
        port = int(sys.argv[1])
    except (IndexError, ValueError):
        port = 5000
    app.run(debug=True, port=port)
Exemplo n.º 5
0
from budget import create_app  # import the create_app function from the __init__.py module in the main budget package (folder)

app = create_app()  # create application
app.app_context().push()

if __name__ == '__main__':
    app.run(debug=True)  # debugger is active