[Flask] Store Data in a SQLite-Database with Flask
d at ddipp.net
Sun Nov 20 14:23:32 EST 2016
Tell me - why do you need a flask?
Flask - web framework, and you have a function, framed by "@app.route"
is caused not through the web, and from the same program.
Try to remove the "@ app.route" to function.
Also, you will not be initialized "g.db". Think about why.
20.11.2016 21:23, Andreas Dorfner пишет:
> Hello everyone,
> I'm new to python and flask web development.
> I have to realize a data logger using flask. By using another
> framework called 'pymodbus', I get some data from
> an energy meter and save that data to a variable called 'crv_data'
> (see file attached). This part is working so far!
> The second part of the project contains the storage of 'crv_data' to a
> SQLite-Database. For that, I'm using flask.
> For creating a table with five columns, a file 'schema.sql' (also
> attached) is included.
> If the file 'logger.py' is running, a database is produced with the
> desired layout and some data in 'crv_data' is available.
> But there is no data included in the database.
> I think there is an error in function 'add_entry()' (starting in line
> 72 of logger.py file), because if I call the function
> in the infinite loop (line 103), the program stops running.
> Maybe I have to say that I using Beaglebone Black with running Debian
> on it.
> Does anybody have an idea, why the program doesn't work?
> Many thanks,
> Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
> Flask mailing list
> Flask at python.org
email: d at ddipp.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Flask