Hello,
I have a dash application that can be seen here: https://jonathanbechtel.pythonanywhere.com/
At the beginning of the page I have a line where I pull in info from a database that reads like the following:
script_directory = os.path.dirname(os.path.abspath(__file__))
data_file = os.path.join(script_directory, "info.pkl")
with open(data_file, 'rb') as info:
connection_info = pickle.load(info)
connection_string = create_connection_string(connection_info)
engine = create_engine(connection_string)
# and get our database info
with engine.connect() as connection:
db_df = pd.read_sql_query('SELECT * FROM jonathanbechtel$covid.predictions ORDER BY dt DESC LIMIT 57',
con=connection)
The issue I'm having is that the data from the query only seems to render new values after I refresh the application in the web console. The database is updated daily so checking the app after 9PM should display new values, but it doesn't automatically, only after the manual refresh.
Any idea why this would be the case? Thank you.