Live data from Hacker News

Poll: Pythonic startups: what web framework do you use?

news.ycombinator.com

31–40 of 76 posts

Re: Poll: Pythonic startups: what web framework do you use?

#31
FriendFeed has an in-house framework inspired by web.py and Appengine's webapp. It was written by Bret Taylor, who was the PM of appengine when it started, but is now working for FriendFeed.

He mentioned that he might open source it, but hasn't done so yet. I encourage people to put some pressure on him to do this =)!

http://bret.appspot.com/entry/experimenting-google-app-engin...

EDIT: I'm not sure who wrote the framework, so I was wrong to say that Bret wrote it. In any case, it was written by FriendFeed developers.

Re: Poll: Pythonic startups: what web framework do you use?

#32
post #23

Earlier quoted context omitted.

The framework may not offer it as part of the framework, but there is nothing stopping you from doing it yourself. It's python, it's a database, what's the difficulty here? Django is not the type of framework where you run deep within it and you cannot break out - nothing stops you from doing anything you want to do.

Of course you're right. Then it's just a matter of assessing the cost of modifying Django vs. another framework.

What I mean is that you do not need to modify Django. You can just write a routine that duplicates whatever you are writing to the database manually. The Django process is easy to break out of from within your app.

Re: Poll: Pythonic startups: what web framework do you use?

#33
post #12

Earlier quoted context omitted.

Django scales just like any other web framework. The plan to scale Django is roughly the same as the plan to scale any app. Are there any issues in particular you're concerned about?

Have you listened to Cal Henderson's friendly rant against Django from a scalability perspective? http://www.youtube.com/watch?v=i6Fr65PFqfk For example, did you modify the source to support multiple databases for read/write? Or is that not an issue and it's OK that it's coming later in the framework's roadmap?

Django has had low level, undocumented hooks for talking to multiple databases for ages (Malcolm talked about these at DjangoCon, the same conference that hosted Cal's excellent keynote). A very recent checkin makes those hooks easier to use: http://code.djangoproject.com/changeset/10026

Re: Poll: Pythonic startups: what web framework do you use?

#34
post #9

For anyone who considered Django and discarded it (especially recently since it's been 1.0), could you maybe explain the decision behind that? I'm curious as a relatively recent Django convert.

It seems that its support for SQLAlchemy isn't really first class. I'm sure its builtin ORM is workable for simple web apps, but if you are doing serious database work in python, there is no substitute for SQLAlchemy.

Of course, you can use whatever other libraries you want in your own code, but at the point where you are not using Django's ORM and you have left its lame template system for something like mako (or maybe genshi, especially if you are generating XML), then what is Django really giving you?

Re: Poll: Pythonic startups: what web framework do you use?

#37
post #7

Would someone that up'd Django please outline their plans to scale?

Ellington, which is a Django based CMS runs the Washington Post web site: http://www.ellingtoncms.com/ I don't have doubts about Django scaling. The caching framework is really cool. I did a test a couple of weeks ago, and I got a 10x performance boost, simply by sprinkling 3-4 lines of caching code to my site. That was justing the local memory caching: http://docs.djangoproject.com/en/1.0/topics/cache/#local-mem...…

If you're using nginx, you can install the memcache module, which lets you speak directly to memcache and bypass Django's CacheMiddleware altogether.

Re: Poll: Pythonic startups: what web framework do you use?

#38
post #33
post #12

Earlier quoted context omitted.

Have you listened to Cal Henderson's friendly rant against Django from a scalability perspective? http://www.youtube.com/watch?v=i6Fr65PFqfk For example, did you modify the source to support multiple databases for read/write? Or is that not an issue and it's OK that it's coming later in the framework's roadmap?

Django has had low level, undocumented hooks for talking to multiple databases for ages (Malcolm talked about these at DjangoCon, the same conference that hosted Cal's excellent keynote). A very recent checkin makes those hooks easier to use: http://code.djangoproject.com/changeset/10026

Very cool. Thanks for this insight.

Re: Poll: Pythonic startups: what web framework do you use?

#39
post #22
post #12

Earlier quoted context omitted.

Have you listened to Cal Henderson's friendly rant against Django from a scalability perspective? http://www.youtube.com/watch?v=i6Fr65PFqfk For example, did you modify the source to support multiple databases for read/write? Or is that not an issue and it's OK that it's coming later in the framework's roadmap?

As I see it, if we get enough traffic to be worried about scaling issues we'll deal with it then. Django isn't terribly designed and going in and hacking multi-db and sharding in should take less than a week from a competent developer. Discussing this before starting a startup sort of feels like trying to figure out how to do salary for hundreds of employees before getting your first one.

I think it's worth discussing these things in depth. Choosing a web framework for your web company is a serious commitment, isn't it?

Re: Poll: Pythonic startups: what web framework do you use?

#40
post #9

For anyone who considered Django and discarded it (especially recently since it's been 1.0), could you maybe explain the decision behind that? I'm curious as a relatively recent Django convert.

I want to preface this by saying that Django isn't bad. It's really good. However, there are some maddening things.

For example:

In Rails, you can say

  Article.find(:all, :include => :comments)
and that will get you the articles with their comments. In Django, you can say

  for a in Article.objects.all():
      a.comments #hits the database again!  argh!
Before you say, "Django has select_related() which does the same thing as Rails!" select_related() doesn't work in any useful way. select_related() only works on the side that defines the foreign key - so you can get the single article that a comment belongs to, but you can't get the comments on an article without running another query. Yeah, that simple, basic, every ORM should support it case isn't handled. And it's maddening.

Forms handling and validation is another sore spot. Some validation happens in the model, some in the form, ModelForms does somethings, but not others, editing related objects is a mess. In some ways it's shocking that it's such a mess considering how awesome the admin interface is. However, I always find myself manually dealing with forms to a point that's just annoying.

The lack of a true "if" in the templates. It's just limiting in a way that I don't find useful and I find that it makes my code less clear by nesting things in weird ways to get the desired effect.

Stagnation. Django is awesome, but sometimes it takes forever for small things to go anywhere because there's a genuine hesitance in the community to "dictators". By dictators, I mean personalities like DHH who say, "well, this way works and is elegant and we're going to go with it." On the one hand, it's what makes Django really attractive as a community. Rails attracts the know-it-all personalities. Maybe DHH and Zed do know it all, but most Rails programmers definitely don't. People in the Django community are really helpful, respectful of other's knowledge, and love learning from each other. However, it also means that even tiny features must be rehashed over and over, filed in triplicate, lost, found, stamped, checked by a committee of 8, rewritten from scratch, named new-X or X-refactor, break API compatibility, and finally get into SVN. Ok, most of that was a joke, but there are lots of little areas where it just seems like Rails is willing to move on something based on the general mood where Django wants a more formal assessment and wait period before deciding whether something is ok to be in or not. And for all people complain about DHH's one-way-to-do-it mentality and Django's more open structure, Rails isn't so closed and Django not so open.

Django's big selling points (for me) are that there's a ton of python out there that's beautiful, reliable code and the admin interface that allows you to deal with content neatly and easily. Clearly there are other selling points like MVC and ORM and whatnot, but there are many frameworks that have that. Django is a lot easier to understand (at least for me) in its implementation. Django's documentation is top notch which is amazing compared to other projects, but Rails is catching up with their guides and screencasts. Django also tends to document things like their file backend hooks better which makes creating plugin-type things easier, but again Rails (with the help of the Merb team) is going to be a ton better in this area.

You won't go wrong with Django. The only fatal flaw is really the first one and it's just unacceptable at this point in time. But it's a great set of code with a wonderful community. I don't think there's another framework I'd prefer. Maybe Rails, but nothing else.

Post reply on HN