gouthambs / Flask-Blogging

A Markdown Based Python Blog Engine as a Flask Extension.
http://flask-blogging.readthedocs.org/en/latest/
MIT License
690 stars 160 forks source link

added img upload to core #95

Closed Speedy1991 closed 7 years ago

Speedy1991 commented 7 years ago

Depending on #93

Speedy1991 commented 7 years ago

IMG_FOLDER = os.path.join("static", "uploads") (or any subdir in static)

MUST be present in config, maybe we should add a default location, dunno

Speedy1991 commented 7 years ago

Hm i'm working on a standalone solution and maybe i'll blueprint this into pypi. You will have to install only my extension/blueprint to your blueprint. It will look exactly the same as the patch i provide in this pr.

Pros:

Cons:

Speedy1991 commented 7 years ago

I put all in a flask extension. I also make a description how to setup with Flask-Blogging. Feel free to install the extension into your core. I think the PR isn't needed except you want to install this fixed version without updates :) https://github.com/Speedy1991/Flask-FileUpload

gouthambs commented 7 years ago

This should work. Edit: Checked your FileUpload package. This is a very clean abstraction. Thanks for separating out. I made some comments in #93, and it looks like you are already handling the abstraction with your Storage. You can perhaps create extensions such as S3Storage etc in the future. :+1:

Speedy1991 commented 7 years ago

Yea, thnx for the hint! I ll close the pr, cause it's not a core feature of blogging. But i ll try to hold it in sync with your master here for easy integration

gouthambs commented 7 years ago

Actually I will merge this feature. It is rather nice to have. Now that you have your extension I can use it instead of repeating all the code here. Do you want to give another PR?

Speedy1991 commented 7 years ago

Yea, i ll create one this evening or tomorrow