Live data from Hacker News

Django plugins you shouldn't start without

blog.hndigest.com

31–40 of 89 posts

Re: Django plugins you shouldn't start without

#31
post #26

Earlier quoted context omitted.

Here's the advice I was given: if you're going to go with an opinionated framework, go with Rails. If you really want to use Python over Ruby, go with Flask. His thought is that Ruby is more dogmatic than Python by design, so Rails' dogmatic nature lends itself to Ruby more. Python's flexibility lends itself to a more flexible, lightweight framework like Flask.

Python is more dogmatic than Ruby. http://www.python.org/dev/peps/pep-0020/ Choosing a minimalistic web framework like Flask or Sinatra makes sense if you're experienced enough to know what choices Django and Rails make for you and you're comfortable making those decisions on your own. Otherwise, pick Django or Rails and start building things.

Couldn't agree with you more. I know what choices django makes for me, and I'm entirely happy letting it. I'd really miss a lot of what django has to offer if I were to move to something like flask.

Re: Django plugins you shouldn't start without

#32
post #10

Earlier quoted context omitted.

For many web programming tasks, your user-perceptible speed and/or maximum system loads will not be dominated by the performance of your web application but rather by database, I/O (including networking), and client performance (JS performance, aggressive asset caching, CDN usage, etc etc). Go or Java are wonderful languages if you have serious number-crunching needs or if cutting your server budget in half would sav…

Not entirely true that the database is the main concern[0]. The overhead of the framework/language has a massive impact. That said, I'm not Google either, and I'm happily using django and love using it. [0] http://www.techempower.com/blog/2013/03/28/frameworks-round-...

How about in Round 7 that Python surpasses Nodejs?

http://www.techempower.com/benchmarks/#section=data-r7

Python didn't beat NodeJS in Database queries though.

Yes Go is fast, but Go is also cluttered with its static type system.

Personally I feel pain to deal with flexible JSON marshal/unmarshal, in Python dict() is nearly 100% identical with JS objects in value.

Re: Django plugins you shouldn't start without

#33
Maybe I'm delusional, but even as someone who has worked pretty extensively (4 months of full stack Django development) with Django, posts like these things make me want to stay away from Django.

I read this post, and I see bandaids. I see bloat, and I see warts. I don't want to build on a codebase that needs 5 extensions out of the box to be sane.

Granted, I know this is not the real story with Django. It is a rather lovely, if rather rigid and stubborn framework (at least it was when I was writing with in circa 1.3). And it is powerful.

But, and this is my point, it seems to me that there is almost no reason I would use Django over something like flask for anything but the most basic of apps. Any time you need to do "serious" work — beyond cookie-cutter stuff — you're going to need to seriously extend Django (or any other web framework for that matter, in my experience/humble opinion). And then it gets ugly, and you're better off building from the ground up on a minimal codebase than trying to contort an existing one to do what you need it to.

Actually, most of my thoughts have been summed up 5 years ago by one of Flikr's lead architects (iirc) at DjangoCon '08 in a brilliant (and hilarious) talk: http://www.youtube.com/watch?v=i6Fr65PFqfk

Re: Django plugins you shouldn't start without

#34
post #32

Earlier quoted context omitted.

Not entirely true that the database is the main concern[0]. The overhead of the framework/language has a massive impact. That said, I'm not Google either, and I'm happily using django and love using it. [0] http://www.techempower.com/blog/2013/03/28/frameworks-round-...

How about in Round 7 that Python surpasses Nodejs? http://www.techempower.com/benchmarks/#section=data-r7 Python didn't beat NodeJS in Database queries though. Yes Go is fast, but Go is also cluttered with its static type system. Personally I feel pain to deal with flexible JSON marshal/unmarshal, in Python dict() is nearly 100% identical with JS objects in value.

> How about in Round 7 that Python surpasses Nodejs

I can't find what you're referring to. Node was still infront of Django in the JSON benchmark.

Django (until 1.6) hasn't had connection pooling for the database either. Updating those benchmarks with pooling should make significant differences.

But my point was that the framework itself can have a huge impact. Database and other I/O does have overhead, and it may even be significant. But it's not necessarily the biggest factor.

Re: Django plugins you shouldn't start without

#35

As someone who is just starting to dive into Django and Python in general I have to admit being confused by benchmark after benchmark that puts Python near to the bottom of the performance curve when compared to other technologies (Go being one that jumps out at me). I have to admit that part of me is wondering if I am making the right decision in investing time, effort and money getting up to speed on Python/Django…

Here's the advice I was given: if you're going to go with an opinionated framework, go with Rails. If you really want to use Python over Ruby, go with Flask. His thought is that Ruby is more dogmatic than Python by design, so Rails' dogmatic nature lends itself to Ruby more. Python's flexibility lends itself to a more flexible, lightweight framework like Flask.

If he's concerned with speed, why recommend Rails? It's just the same as Django in that department, if not slower. My advice to someone asking this question is to pick the language they feel the most expressive in, and then pick the framework. Django's a fine choice.

That being said, I'd love to see a microframework like Flask for Lua/openresty gain in popularity.

Re: Django plugins you shouldn't start without

#36

As someone who is just starting to dive into Django and Python in general I have to admit being confused by benchmark after benchmark that puts Python near to the bottom of the performance curve when compared to other technologies (Go being one that jumps out at me). I have to admit that part of me is wondering if I am making the right decision in investing time, effort and money getting up to speed on Python/Django…

I'll provide a dissenting opinion from everyone else and say that it's very nice being able to run a large site from a small number of web servers with very snappy requests, and to do this, it helps to not have the framework eat up 100ms. Also, a well tuned database or KV store can be extremely fast - just make sure all data is buffered in RAM and/or on SSDs.

Doing this right saves you from having to go all out on caching, and it can help keep your infrastructure simple, the benefits of which shouldn't be underestimated if you have a small team.

Also, if you're building interactive B2C sites and have some success, server costs can quickly become nontrivial, to the point where a 2-3x speedup can make a large monetary difference, and it's easier to not have to rewrite things for speed. If you're building B2B SAAS sites, server costs are probably a complete nonissue.

Re: Django plugins you shouldn't start without

#37
In context of this article (at least), Sekizai is useless. You've been able to do this out-of-the-box with Django for a very long time. You can always reference inherited content in a Django block with {{ block.super }}. This feature has been around since AT LEAST v1.1. That's when I found the feature.

Re: Django plugins you shouldn't start without

#38
post #33

Maybe I'm delusional, but even as someone who has worked pretty extensively (4 months of full stack Django development) with Django, posts like these things make me want to stay away from Django. I read this post, and I see bandaids. I see bloat, and I see warts. I don't want to build on a codebase that needs 5 extensions out of the box to be sane. Granted, I know this is not the real story with Django. It is a rathe…

If it helps any, as someone who's been building Django sites for years, I will say that while all of those are at least handy, absolutely none of them is needed.

On the list, the only one I use with any regularity is South, which I do consider must-have. That said, it seems that the Django core team agrees, as it's being (or maybe is even finished) pulled into Django core.

Re: Django plugins you shouldn't start without

#39

What, no django-annoying? That's the first thing I ever use: https://github.com/skorokithakis/django-annoying That, and shortuuid: https://pypi.python.org/pypi/shortuuid/ Disclosure: I maintain one and wrote the other, but they and South are the three things I use for every project.

ShortUUID looks like fun. I usually just get a UUID4 and grab the last section of the generated UID.

Something like str(uuid.uuid4()).split("-")[4]

I'd like to say that I then do a duplicate check, but I don't think I've ever had a collision, so I'm not actually 100% true that I do.

Best case, you've saved me a database query, worst case, you've saved me a potentially painful Exception.

Danke.

Post reply on HN