gamegos / cesi

CeSI is a web interface for managing multiple supervisors from the same place.
GNU General Public License v3.0
571 stars 184 forks source link

Please help :AttributeError: 'Flask' object has no attribute 'teardown_appcontext' #21

Closed Luolired closed 5 years ago

Luolired commented 8 years ago

root@Soc:/home/lizx/cesi# vi /etc/cesi.conf

[node:220] username = soc_web password = XXXX host = 10.1.101.220 port = 9001

[node:] ;username = ;password = ;host = ;port =

[environment:soc_web] members = 220

[cesi] database =/home/lizx/cesi/userinfo.db activity_log =/home/lizx/cesi/cesi_activity.log host = 0.0.0.0

root@Soc:/home/lizx/cesi# python cesi/web.py Traceback (most recent call last): File "cesi/web.py", line 27, in @app.teardown_appcontext AttributeError: 'Flask' object has no attribute 'teardown_appcontext'

kozdincer commented 8 years ago

What is your flask version? How did you install the flask? (pip, etc.)

Luolired commented 8 years ago

Flask (0.8) Ubuntu 12.04.5 LTS \n \l

pip install flask

Close database connection

@app.teardown_appcontext 《====Solution add "#"

def close_connection(exception): db = getattr(g, '_database', None) if db is not None: db.close()

Success OK

f9n commented 5 years ago

Please reopen with additional details if this is still a problem for new version.

Shardj commented 3 years ago

@Luolired I don't really see how commenting out the problematic line is a solution. Is a bug fixed when you delete the codebase it's in?