top | item 7029532

Pecan a lean Python web framework

49 points| poissonpie | 12 years ago |pecanpy.org

17 comments

order

codegeek|12 years ago

I have been learning Flask for a while and any other python based light frameworks are of interest. This looks promising with its own set of conventions but one thing that immediately caught my eye is this:

    pecan create test_project
Essentially, it creates a barebone project with a list of pre-defined folders/files. For me, this is not very useful as I actually prefer to create my own. In fact, as you get to a decent sized project, you always end up customizing the structure of the app and hence a barebone structure even though sounds good actually becomes unusable. For a lightweight framework, I really don't want any app structure conventions done for me. Let me do that.

mildtrepidation|12 years ago

Essentially, it creates a barebone project with a list of pre-defined folders/files. For me, this is not very useful as I actually prefer to create my own.

Unless this command is vastly more opinionated (and less bare-bones) than Django's startapp/startproject, and with only what you've written to go on, I get the impression that what you're doing here is killing part of the benefit a framework gives you: The ability for others with framework experience to (relatively) quickly pick up your projects and work on them.

I've worked on several projects that did similar things in addition to many that more strictly followed their framework's conventions, and choice of framework aside, when you're using something lightweight already but ignoring its conventions, you might as well be rolling your own.

If that's not something that's important to you when choosing a framework, for whatever reason, then I can see this being OK (if not useful). But I don't think it's a good habit to get into if you are likely to pass off your work to others or need to bring in outside help in the future.

fingerprinter|12 years ago

I actually love this option, particularly when learning something new. I actually wish Flask had this with some options to preselect libs.

Padrino uses generators[1] for this and while they might have too many options, something like this for Flask would be fantastic, IMO.

[1] - http://www.padrinorb.com/guides/generators

nubela|12 years ago

What's wrong with Flask, or the better question is. What does Pecan do better than Flask?

rch|12 years ago

It looks like they might claim: "object-dispatch style routing"

Maybe I'm missing something, but I don't see a substantial improvement over Flask's (or even Werkzeug's) approach.

mattlutze|12 years ago

I'm having trouble understanding from the paragraph intro on the site, why I would need this in the growing market of python-in-my-browser tools. I've used the language mostly as scripts to process piles of data -- if I were to get into generating web content, why this over one of the "inspirations" or other packages?

dorfsmay|12 years ago

Is it leaner than bottle or flask?

It diesn't seem as clean on a first glance?

pekk|12 years ago

Can you be specific about what doesn't seem as clean?

pc86|12 years ago

What use is a web framework that "includes no out of the box support for things like sessions or databases?"

pekk|12 years ago

Flask doesn't include an ORM either, and it's very popular. For example.

jpwagner|12 years ago

this is where "light-weight" comes in. you could do something like use werkzeug's secure cookies and sqlalchemy for sessions and databases respectively.