Kenneth Reitz
Kenneth Reitz

Reputation: 8846

Django vs. Pylons

I've recently become a little frustrated with Django as a whole. It seems like I can't get full control over anything. I love Python to death, but I want to be able (and free) to do something as simple as adding a css class to an auto-generated form.

One MVC framework that I have really been enjoying working with is Grails (groovy). It has a FANTASTIC templating system and it lets you really have full control as you'd like.

However, I am beyond obsessed with Python. So I'd like to find something decent and powerful written in it for my web application development.

Any suggestions?

Pylons maybe?

Upvotes: 19

Views: 11490

Answers (4)

Stijn Debrouwere
Stijn Debrouwere

Reputation: 256

With the risk of going a bit off-topic here, "I want to be able (and free) to do something as simple as adding a css class to an auto-generated form" might not be the best indicator of the power (or lack of power) of a framework. Form generation is notoriously hard to do in a flexible way (cf. http://blog.ianbicking.org/on-form-libraries.html), and frameworks will always need to weigh ease-of-use versus supporting advanced use-cases. I've used form generation in Pylons before, and didn't find it to be particularly better or easier than how things work in Django (but not harder either).

Upvotes: 1

Daniel Naab
Daniel Naab

Reputation: 23056

Something as simple as adding CSS classes to Django form fields IS possible.

Upvotes: 1

Tristan
Tristan

Reputation: 6906

Pylons is not that much simpler than Django and it doesn't seem to have the same community. For lightweight apps I would recommend web.py. Even though there is a little magic, it doesn't feel like it. You see everything you do. For lots of other ideas see this very current list of web resources on python.

Upvotes: 5

Jason S
Jason S

Reputation: 13779

I'm using Pylons right now. The flexibility is great. It's all about best-of-breed rather than The Django Way. It's more oriented toward custom application development, as opposed to content-based web sites. You can certainly do content sites in it; it's just not specifically designed for them.

On the other hand, you do end up needing to read a lot of different documentation, in different places, of different quality, to grok all the components. Whereas one of the nice things about Django is that for all the core components, you just read "the" documentation.

The Mako (templates) + SQLAlchemy (DB & ORM) combo is really nice, though. Back when I used Django, I replaced its templating and DB system with them (giving up some of its integration features in the process) and they are standard with Pylons. Mako lets you use Python expressions, which is nice because even though you should separate business logic from design, dynamic sites do require significant display logic, and Django's template tags are clumsy to work with. SQLAlchemy lets you work with the same data model anywhere from the raw SQL level to the object-oriented ORM level.

I think it's worth the time to at least go through the docs and do the QuickWiki tutorial.

Upvotes: 20

Related Questions