librelist archives

« back to archive

Flask-FlatPages and Flask-Static

Flask-FlatPages and Flask-Static

From:
Simon Sapin
Date:
2010-12-25 @ 02:38
Hi everyone,

I am proud to release two Flask extensions:

Flask-FlatPages is for those times a relational database feels like 
overkill for storing a few pages of text.
Instead, it manages a set of text files and give easy access to each via 
iteration or OS-independent paths. Text files are also easier to diff 
and put in version control than, say, a SQLite file. This is read-only 
for now as I have no need of modifying pages from Flask, but adding 
support for writing should be doable.

Docs: http://packages.python.org/Flask-FlatPages/
Code: https://github.com/SimonSapin/Flask-FlatPages

Flask-Static is yet another static website generator like Jekyll/Hyde 
and many others, but just takes a Flask application instead inventing 
new mechanisms such as media processors to provide flexibility.
This is Python. Tools are available. Infinite flexibility is there. You 
know what to do.

Docs: http://packages.python.org/Flask-Static/
Code: https://github.com/SimonSapin/Flask-Static

I wrote these to use them together for my yet-to-be-published interblag, 
but they should work independently.

Whether you think this is great or that something in there is horribly 
wrong, any feedback is welcome. Oh and if anyone feels like making a 
logo, that would be nice though not essential.

Armin, I’d like these to be approved if you have some time to look at 
it. I’ll release a 0.1 version of each after that.

Also, thanks Armin and the Pocoo team for Flask, Jinja, Sphinx and 
Pygments that are a pleasure to use, and happy holidays to everyone.

Best regards,
-- 
Simon Sapin

Re: [flask] Flask-FlatPages and Flask-Static

From:
Dag Odenhall
Date:
2010-12-25 @ 12:58
On Sat, 2010-12-25 at 11:38 +0900, Simon Sapin wrote:
> Hi everyone,
> 
> I am proud to release two Flask extensions:
> 
> Flask-FlatPages is for those times a relational database feels like 
> overkill for storing a few pages of text.
> Instead, it manages a set of text files and give easy access to each via 
> iteration or OS-independent paths. Text files are also easier to diff 
> and put in version control than, say, a SQLite file. This is read-only 
> for now as I have no need of modifying pages from Flask, but adding 
> support for writing should be doable.
> 
> Docs: http://packages.python.org/Flask-FlatPages/
> Code: https://github.com/SimonSapin/Flask-FlatPages
> 
> Flask-Static is yet another static website generator like Jekyll/Hyde 
> and many others, but just takes a Flask application instead inventing 
> new mechanisms such as media processors to provide flexibility.
> This is Python. Tools are available. Infinite flexibility is there. You 
> know what to do.
> 
> Docs: http://packages.python.org/Flask-Static/
> Code: https://github.com/SimonSapin/Flask-Static

Also, you might want to add a configuration option for the SCRIPT_ROOT
for deployments not at the root level of the domain. WSGI normally
handles this for you but will not for a static site. This is essential
for url_for() to generate correct paths, etc.

> 
> I wrote these to use them together for my yet-to-be-published interblag, 
> but they should work independently.
> 
> Whether you think this is great or that something in there is horribly 
> wrong, any feedback is welcome. Oh and if anyone feels like making a 
> logo, that would be nice though not essential.
> 
> Armin, I’d like these to be approved if you have some time to look at 
> it. I’ll release a 0.1 version of each after that.
> 
> Also, thanks Armin and the Pocoo team for Flask, Jinja, Sphinx and 
> Pygments that are a pleasure to use, and happy holidays to everyone.
> 
> Best regards,


Re: [flask] Flask-FlatPages and Flask-Static

From:
Simon Sapin
Date:
2010-12-25 @ 15:32
Le 25/12/2010 21:58, Dag Odenhall a écrit :
> Also, you might want to add a configuration option for the SCRIPT_ROOT
> for deployments not at the root level of the domain. WSGI normally
> handles this for you but will not for a static site. This is essential
> for url_for() to generate correct paths, etc.

Here it is:

https://github.com/SimonSapin/Flask-Static/commit/96fed2f5d6163fba69c0e9d043edb2cc49c7fb39

As far as I can tell it only affects url_for()

Regards,
-- 
Simon Sapin

Re: [flask] Flask-FlatPages and Flask-Static

From:
danjac354@gmail.com
Date:
2010-12-26 @ 15:28
Thanks for these. It would be good to add some more approved
extensions to the list (along with Flask-MongoAlchemy).

On 25 December 2010 15:32, Simon Sapin <simon.sapin@exyr.org> wrote:
> Le 25/12/2010 21:58, Dag Odenhall a écrit :
>> Also, you might want to add a configuration option for the SCRIPT_ROOT
>> for deployments not at the root level of the domain. WSGI normally
>> handles this for you but will not for a static site. This is essential
>> for url_for() to generate correct paths, etc.
>
> Here it is:
> 
https://github.com/SimonSapin/Flask-Static/commit/96fed2f5d6163fba69c0e9d043edb2cc49c7fb39
>
> As far as I can tell it only affects url_for()
>
> Regards,
> --
> Simon Sapin
>

Re: [flask] Flask-FlatPages and Flask-Static

From:
Dag Odenhall
Date:
2010-12-25 @ 12:52
On Sat, 2010-12-25 at 11:38 +0900, Simon Sapin wrote:
> Hi everyone,
> 
> I am proud to release two Flask extensions:
> 
> Flask-FlatPages is for those times a relational database feels like 
> overkill for storing a few pages of text.
> Instead, it manages a set of text files and give easy access to each via 
> iteration or OS-independent paths. Text files are also easier to diff 
> and put in version control than, say, a SQLite file. This is read-only 
> for now as I have no need of modifying pages from Flask, but adding 
> support for writing should be doable.
> 
> Docs: http://packages.python.org/Flask-FlatPages/
> Code: https://github.com/SimonSapin/Flask-FlatPages
> 
> Flask-Static is yet another static website generator like Jekyll/Hyde 
> and many others, but just takes a Flask application instead inventing 
> new mechanisms such as media processors to provide flexibility.
> This is Python. Tools are available. Infinite flexibility is there. You 
> know what to do.
> 
> Docs: http://packages.python.org/Flask-Static/
> Code: https://github.com/SimonSapin/Flask-Static

http://packages.python.org/Flask-Static/#configuration

"Flask-FlatPages accepts the following configuration value:"


Looks good anyway, I've had plans for something very similar.

> 
> I wrote these to use them together for my yet-to-be-published interblag, 
> but they should work independently.
> 
> Whether you think this is great or that something in there is horribly 
> wrong, any feedback is welcome. Oh and if anyone feels like making a 
> logo, that would be nice though not essential.
> 
> Armin, I’d like these to be approved if you have some time to look at 
> it. I’ll release a 0.1 version of each after that.
> 
> Also, thanks Armin and the Pocoo team for Flask, Jinja, Sphinx and 
> Pygments that are a pleasure to use, and happy holidays to everyone.
> 
> Best regards,


Re: [flask] Flask-FlatPages and Flask-Static

From:
Simon Sapin
Date:
2010-12-25 @ 12:57
Le 25/12/2010 21:52, Dag Odenhall a écrit :
> http://packages.python.org/Flask-Static/#configuration
>
> "Flask-FlatPages accepts the following configuration value:"

Thanks, fixed.

That’s what happens when you do two things at once :)