mikeboers / Flask-Images

On-demand resizing of images for Flask applications.
https://mikeboers.github.io/Flask-Images/
BSD 3-Clause "New" or "Revised" License
81 stars 43 forks source link

AttributeError: 'Flask' object has no attribute 'add_template_global' #21

Closed maksad closed 10 years ago

maksad commented 10 years ago

I am getting this error when trying to initialize Flask-Images. app = Flask( name ) app.secret_key = 'secretkeythatyouneverguess' images = Images(app) Have no idea why. Tried to google it but not any solution for that.

here is the full error statement:

File "./run.py", line 3, in from app import app File "/home/proj/app/ init .py", line 15, in images = Images(app) File "/home/proj/flask/local/lib/python2.7/site-packages/flask_images.py", line 54, in init self.init_app(app) File "/home/proj/flask/local/lib/python2.7/site-packages/flask_images.py", line 70, in init_app app.add_template_global(resized_img_src) AttributeError: 'Flask' object has no attribute 'add_template_global'

mikeboers commented 10 years ago

I think this is because the add_template_global method is new to Flask v0.10.

Can you check what version of Flask you have?

I'll make it more backwards compatible and re-release, but I just want to be sure.

maksad commented 10 years ago

Yes you are right. My version of Flask is 0.9. Probably I have to upgrade it to use Flask-Images. Thank you very much for great package and support :+1:

mikeboers commented 10 years ago

If you want to upgrade, go for it. I'll make it backwards compatible anyways. I'm not in a position to do it right now, but in a couple hours...

maksad commented 10 years ago

Ok thank you :)

mikeboers commented 10 years ago

This has been released on PyPI as v2.0.0 (due to a minor backwards incompatible change).

Cheers,

Mike