Flask-Images icon indicating copy to clipboard operation
Flask-Images copied to clipboard

Improve docs re: configuration and examples

Open cbronazc opened this issue 10 years ago • 5 comments

IMAGES_PATH seems to only work as a list, can someone at least put this in the docs. IMAGES_NAME, I can't for the life of me figure out what this does Also it would be nice to have the from flask.ext.images import resized_img_src or url_for somewhere in the docs.

cbronazc avatar Oct 13 '14 20:10 cbronazc

Thanks for your feedback!

The docs currently reside entirely in the README.

IMAGES_PATH could be a bit clearer, I agree, but IMAGES_NAME is described with the rest of the configuration.

The introduction covers the resized_img_src and url_for use cases; are you saying this is not enough, or was not visible enough?

Cheers,

Mike

mikeboers avatar Oct 13 '14 20:10 mikeboers

That was a quick response, I can submit a PR for the README IMAGES_PATH and url_for part if you want.

For IMAGES_NAME, I saw that part in the configs, but I don't understand what "The name of the registered endpoint" means. Is that the endpoint of the flask view method ? Whats the purpose of setting this variable ? It doesn't affect the generated url at all, or the location of the image storage or declare it as a set or anything. I read through the code but I'm just not grasping it.

I get how url_for and the other is used, but newbies might have a hard time understanding that you need to import them from this package, not from flask import x but from flask.ext.images import x. Putting that right above "Configuration" would be helpful.

Thanks!

cbronazc avatar Oct 13 '14 21:10 cbronazc

Fair enough on all points. Some examples and slightly more conventional docs all around would be good. I also think that is one of the very last missing criteria for "approved" Flask extensions.

IMAGES_NAME is the endpoint of the Flask view method. Setting it allows for avoiding conflicts with another endpoint called "images". Without doing any research and just answering off the cuff, I'm 50-50 on if that sort of thing could/should be solved with blueprints.

mikeboers avatar Oct 13 '14 21:10 mikeboers

I'm going to leave this open as the last thing to do for #11.

mikeboers avatar Oct 21 '14 15:10 mikeboers

Thanks for cbronazc's notice, otherwise I would still be crazy for Flask-Images not working. Now I NOTICE that, the IMAGES_PATH is a list, not a single path string. change my: IMAGES_PATH = "static" to: IMAGES_PATH = ["static"] then made it work!

crifan avatar Aug 25 '16 09:08 crifan