You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from dotenv import load_dotenv
import os
from flask import Flask, session
from flask_session import Session
import pymongo
load_dotenv()
app = Flask(__name__)
MONGO_URI = os.environ.get("MONGO_URI")
client = pymongo.MongoClient(MONGO_URI)
neoDB = client.mydb
SESSION_TYPE = os.environ.get("SESSION_TYPE")
app.config['SECRET_KEY'] = 'mysecret'
app.config["SESSION_TYPE"] = SESSION_TYPE
app.config["SESSION_MONGODB"] = client
app.config["SESSION_MONGODB_DB"] = "mydb"
app.config["SESSION_MONGODB_COLLECT"] = "sessions"
sess = Session()
sess.init_app(app)
from User import routes
if __name__ == '__main__':
app.run(host='127.0.0.1', port=5000, deb
Every time I try to access a route a get the following error:
File "/Documents/Portifólio/authSystem/env/lib/python3.8/site-packages/flask_session/sessions.py", line 456, in save_session self.store.update({'id': store_id}, File "/Documents/Portifólio/authSystem/env/lib/python3.8/site-packages/pymongo/collection.py", line 2584, in __call__ raise TypeError("'Collection' object is not callable. If you meant to " TypeError: 'Collection' object is not callable. If you meant to call the 'update' method on a 'Collection' object it is failing because no such method exists.
Somebody pointed out that it is due to the fact that update method was removed from pymongo.collection in version 4.0.
The text was updated successfully, but these errors were encountered:
Code example
Every time I try to access a route a get the following error:
File "/Documents/Portifólio/authSystem/env/lib/python3.8/site-packages/flask_session/sessions.py", line 456, in save_session self.store.update({'id': store_id}, File "/Documents/Portifólio/authSystem/env/lib/python3.8/site-packages/pymongo/collection.py", line 2584, in __call__ raise TypeError("'Collection' object is not callable. If you meant to " TypeError: 'Collection' object is not callable. If you meant to call the 'update' method on a 'Collection' object it is failing because no such method exists.
Somebody pointed out that it is due to the fact that update method was removed from pymongo.collection in version 4.0.
The text was updated successfully, but these errors were encountered: