19

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?

JasonMond
  • 1,440
  • 1
  • 16
  • 30
Kenneth Reitz
  • 8,559
  • 4
  • 31
  • 34
  • 1
    You might want to check Turbogears too. – Joshua Partogi Aug 28 '09 at 03:35
  • @EvanPlaice the question you linked has been deleted - would you be willing to remove your comment for the sake of future readers? (I will also delete this comment.) Thanks! (PS I've been working on https://github.com/cxw42/pym and so https://github.com/evanplaice/pypreprocessor jumps out at me --- looks nice! :) ) – cxw Mar 01 '17 at 16:25
  • @cxw PYM looks interesting and very similar in scope/functionality to pypreprocessor. I'd rather not go too off-topic here, if you'd like to talk more feel free to email me at my handle at gmail. – Evan Plaice Apr 06 '17 at 06:30
  • @EvanPlaice Thanks for your note! I will email. Sorry I haven't done so yet --- I've been buried at work this month. I appreciate your understanding! – cxw Apr 27 '17 at 12:28

4 Answers4

20

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.

Jason S
  • 13,538
  • 2
  • 37
  • 42
  • 1
    seconded. I looked at both Django and Pylons when selecting a framework to work with on a new project. Based on my research it seemed to me Pylons was WAY more flexible and easier to understand, IMHO. If you haven't already check out http://pylonsbook.com/ for the book – jdiaz Aug 28 '09 at 03:20
  • 1
    Thanks, it looks like Pylons is much more my style. I like convention + power. I don't like how Django tries to do everything for me. AOL worked long and hard to show the world how not to do things. *And the transition begins* Thanks! – Kenneth Reitz Aug 28 '09 at 03:28
  • 2
    I agree -- while Django's much more popular, it's very "deep, rich and magical" and I personally prefer to use as lightweight an approach as I can get away with (have you looked at werkzeug, for example..?). – Alex Martelli Aug 28 '09 at 05:30
  • 1
    I can't really see what's magical with django. I mean, I have been coding by hand then using Symfony for a while. Now, using Django not only save me time, but seems obvious to me as well. I think what a lot of people call magic is just something that is not perfectly understood, but really, in Django, you can replace ANYTHING. – Bite code Aug 28 '09 at 13:40
  • Django is best suited for rapid deployment of a content driven site. If you are developing a web app that barely requires an admin and you want to talk to more than one database at a time, Pylons is the way to go. – Thierry Lam Aug 28 '09 at 17:27
  • Althou I mostly agree, you forgot to mention the biggest Django advantage - reusable apps and the community around them. – Almad Apr 09 '10 at 12:29
5

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.

Tristan
  • 6,776
  • 5
  • 40
  • 63
  • It doesn't have a community that runs out and brags about how awesome it is, they're busy actually doing work. I've found it just as supportive and IMO more supportive then django was, though YRMV. – William Chambers May 09 '11 at 08:00
1

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

Daniel Naab
  • 22,690
  • 8
  • 54
  • 55
  • Form-fields, yes (though it's not simple). Input fields generated by TextModel controls? no. – Kenneth Reitz Aug 28 '09 at 03:35
  • I'm not sure what you're referring to by "Input fields generated by TextModel controls"... you were referring to forms, and all elements in a form are "fields"... and it doesn't seem very difficult to me. – Daniel Naab Aug 28 '09 at 06:26
  • Same here, you can replace, override anything in Django. I don't see how it can bee easier than that... – Bite code Aug 28 '09 at 13:43
  • @e-satis - Because that's exactly what I want a maximalist framework for, to replace and override features. – orokusaki Sep 19 '10 at 18:12
  • Don't understand your anwser. First I say "you can do it, what the matter" and you answer "because I want to do it". Secondly, all frameworks are not aiming the same purpose. Maybe you want something decoupled like Pylon, maybe you want something loosely coupled like Django. That's a matter of taste, not a way to define how things should be. – Bite code Sep 19 '10 at 19:11
1

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).