Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Set flask version to the last one with session_cookie_name (v2.2.5) #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Saigesp
Copy link

@Saigesp Saigesp commented Jun 5, 2023

Problem

When running the application, it throws a 500 error:

Traceback (most recent call last):
  File "/home/santi/.virtualenvs/xero-python/lib/python3.10/site-packages/flask/app.py", line 2189, in wsgi_app
    ctx.push()
  File "/home/santi/.virtualenvs/xero-python/lib/python3.10/site-packages/flask/ctx.py", line 377, in push
    self.session = session_interface.open_session(self.app, self.request)
  File "/home/santi/.virtualenvs/xero-python/lib/python3.10/site-packages/flask_session/sessions.py", line 319, in open_session
    sid = request.cookies.get(app.session_cookie_name)
AttributeError: 'Flask' object has no attribute 'session_cookie_name'

Cause

When installing the application the latest version of Flask is installed, but as of version 2.3.0 flask removed the session_cookie_name and other properties.

The session_cookie_name, send_file_max_age_default, use_x_sendfile,
propagate_exceptions, and templates_auto_reload properties on app are removed.

Flask changelog for version 2.3.0 here.

Solution

Set the flask version to 2.2.5 in requirements.txt

flask==2.2.5

Copy link

@hui-jie-lim hui-jie-lim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encountered similar issues. If it helps, I can verify that fix will solve this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants