I am using this code for my project . It works well until the gauge section. But when I am trying to have the history graphs I am getting this error:
" * Running on http://0.0.0.0:80/ (Press CTRL+C to quit)
[2020-09-05 20:34:12,647] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python3/dist-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3/dist-packages/flask/_compat.py", line 35, in reraise
raise value
File "/usr/lib/python3/dist-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "WebHist1.py", line 92, in index
time, temp, hum = getLastData()
File "WebHist1.py", line 28, in getLastData
for row in curs.execute("SELECT * FROM temp ORDER BY date DESC LIMIT 1"):
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 1996245712 and this is thread id 1941664864.
192.168.0.20 - - [05/Sep/2020 20:34:12] "GET / HTTP/1.1" 500 -
192.168.0.20 - - [05/Sep/2020 20:34:13] "GET /favicon.ico HTTP/1.1" 404 -
"
Can you please help on this error