Re: [flask] Approved: Frozen-Flask
- From:
- Simon Sapin
- Date:
- 2011-06-05 @ 09:57
Le 05/06/2011 10:58, Ron DuPlain a écrit :
> I just added Frozen-Flask to the list of approved extensions.
> http://packages.python.org/Frozen-Flask/
Hi Ron,
Thanks for the approval and the feedback!
> For Simon and other Frozen-Flask contributors, some recommendations:
>
> * Do not silently build an app that has URL rules with arguments that
> do not have a URL generator. Warn or raise an error, providing
> options in app.config.
> * Consider adding an init_app function.[1]
I hadn’t thought about this, but I will for the next release. I’m not
sure about the use case for init_app. (A Freezer instance without an app
does nothing.) But I guess it doesn’t hurt, for consistency with other
extensions.
It’s just me for now, but any contribution or feedback is welcome.
> * Note in the docs that this extension does not support URLs external
> to the app routes.
This could be clearer in the docs (I’ll add an example), but URL
generators can yield strings. These are URLs like url_for() would return
and are passed as-is to the test client.
> * Update repo (and therefore setup.py/conf.py) to your recent 0.4 release.
> * Update GitHub to point to Frozen-Flask homepage, from Flask-Static.
> * Update sphinx conf.py attributes from FlatPages
Fixed in git. Please do report by email or on the tracker if you find
anything else, or for requests.
> I have been using this extension for production work over the past few months.
I’m glad to see it used more than just for my personal website. I
recently switched a dozen websites to Frozen-Flask at work myself.
> Everything was really intuitive for me, and the only places my
> projects tripped was on content types, [...]
This is expected, I couldn’t find a way around it. If you have URLs
without a training slash (index.html) or file extensions, a traditional
web server would serve it as application/octet-stream which is probably
not what you want. I prefer complaining loudly.
Regards,
--
Simon Sapin
http://exyr.org/
Re: [flask] Approved: Frozen-Flask
- From:
- Ron DuPlain
- Date:
- 2011-06-05 @ 14:13
On Sun, Jun 5, 2011 at 5:57 AM, Simon Sapin <simon.sapin@exyr.org> wrote:
> Le 05/06/2011 10:58, Ron DuPlain a écrit :
>> * Consider adding an init_app function.[1]
>
> I hadn’t thought about this, but I will for the next release. I’m not
> sure about the use case for init_app. (A Freezer instance without an app
> does nothing.) But I guess it doesn’t hurt, for consistency with other
> extensions.
This is to support patterns where you'd like to build out an instance
of the extension class (Freezer in this case) when you don't have an
app yet. It's not as essential for Frozen-Flask as it is in
Flask-SQLAlchemy, but an init_app would be useful imo, as it would
provide for registering URL generators more flexibly.
>> I have been using this extension for production work over the past few months.
>
> I’m glad to see it used more than just for my personal website. I
> recently switched a dozen websites to Frozen-Flask at work myself.
>
>> Everything was really intuitive for me, and the only places my
>> projects tripped was on content types, [...]
>
> This is expected, I couldn’t find a way around it. If you have URLs
> without a training slash (index.html) or file extensions, a traditional
> web server would serve it as application/octet-stream which is probably
> not what you want. I prefer complaining loudly.
Definitely complain loudly. This error was the only one I came across
that I didn't expect. I'm not sure it needs to be addressed by
Frozen-Flask, and you already have it clearly documented. :-)
Great!
Ron