Ok I may decide to add again the "keep_existing": True, however this shouldn't be needed. If you delete or comment the following lines and use 0.8.0, I would be interested to know the result. There should be no need to manually create the table as flask-session does this now.
# try:
# from book_keeping.library.fixed_session import FixedSession as Session
# except ImportError:
# print( 'from flask_session import Session' )
from flask_session import Session
I have been a software develper for around 20 years. I am looking forward to work with Python. My other blogs:
https://behainguyen.wordpress.com/
https://behai-nguyen.github.io/
Location
Melbourne, Australia
Education
Master of Applied Science in Computer Science, RMIT, Victoria, Australia
Tests raise the old exception (0.4.0). But the sessions table gets created.
venv\Scripts\flask.exe run no longer raises the old exception (0.4.0) and the table sessions table also gets created.
Please note that, I posted this article on the 24th, November 2022. And labelled the code for this article. That is why I am able to get the code test this problem. I forgot to label database version!
Since the this article, I added more functionalities including database changes till around May 2023, I have since stopped working on this project.
For these tests, for the application (that is, venv\Scripts\flask.exe run), I can only get to the login page. But that should be enough.
Please let me know if you want me to do anything else.
I have been a software develper for around 20 years. I am looking forward to work with Python. My other blogs:
https://behainguyen.wordpress.com/
https://behai-nguyen.github.io/
Location
Melbourne, Australia
Education
Master of Applied Science in Computer Science, RMIT, Victoria, Australia
I do apologise for all the fault alarms. I appreciate your helps.
Thank you and best regards,
...behai.
P.S.
Just a side note, my application has a view session functionality for admins, whereby it just displays existing sessions as JSON. I was using pickle to serialise the session data. Flask-Session 0.8.0 now uses msgspec, the serialisation of sessions.data is now:
Ok I may decide to add again the "keep_existing": True, however this shouldn't be needed. If you delete or comment the following lines and use 0.8.0, I would be interested to know the result. There should be no need to manually create the table as flask-session does this now.
and
with app.app_context():
Hi Lex,
Based on your advice:
E:\book-keeping\src\book_keeping\__init__.py
modified to:I have also decided to use latest of everything,
E:\book-keeping\setup.py
updated to:I am using the original
Flask-Session 0.8.0
:Test 1: table
sessions
exists:The application runs. That is,
venv\Scripts\flask.exe run
does not raise exception.Tests no longer raise the table
sessions
exists exception. They now raise another unrelated exception.Test 2: I manually removed the existing
sessions
table:The results are as in Test 1. BUT THE TABLE
sessions
DOES NOT GET CREATED.Further note:
With:
Tests raise the old exception (0.4.0). But the
sessions
table gets created.venv\Scripts\flask.exe run
no longer raises the old exception (0.4.0) and the tablesessions
table also gets created.Please note that, I posted this article on the 24th, November 2022. And labelled the code for this article. That is why I am able to get the code test this problem. I forgot to label database version!
Since the this article, I added more functionalities including database changes till around May 2023, I have since stopped working on this project.
For these tests, for the application (that is,
venv\Scripts\flask.exe run
), I can only get to the login page. But that should be enough.Please let me know if you want me to do anything else.
Thank you and best regards,
...behai.
Hi @lxstr,
Your advice works.
And this report from my last response is not correct:
There was something in my code what caused it not to work. I am using all latest packages now.
There is no need for:
I do apologise for all the fault alarms. I appreciate your helps.
Thank you and best regards,
...behai.
P.S.
Just a side note, my application has a view session functionality for admins, whereby it just displays existing sessions as JSON. I was using
pickle
to serialise the session data.Flask-Session 0.8.0
now usesmsgspec
, the serialisation ofsessions.data
is now: