Live data from Hacker News

Must-have Django packages

devcharm.com

61–70 of 100 posts

Re: Must-have Django packages

#64

Everyone recommends the django-toolbar for spotting slowdowns in your SQL... ok, installed it. I almost never see any tips on how to actually do that though. What now? (I suppose the SQL part of my app is not the problem though, rather the number crunching that happens on the data returned. I do lots of caching on the results instead to make the site seem responsive.)

I would say there are two primary ways DDT helps you spot database performance problems.

The first is that "oh my god" moment when you see via DDT that your view is doing 100+ queries to the database. This leads to research into Django ORM features like "select_related" and other ways to cut down the number of queries.

The second is clicking DDT's handy EXPLAIN button on a single query that is taking a long time. Sometimes this can help improve performance by adding an index to a field.

Re: Must-have Django packages

#67

Interesting, my fairly large django project uses none of those. Instead, the addons we consider to be critical are these these: django-debreach django-redis jinja2 pytz Redis for queues and caching, debreach to secure the CSRF tokens and vary your content length to avoid the BREACH vulnerability. jinja2 for doing templates outside of returning data, and pytz so you can use timezones in your data models. I also recomm…

Does django-redis block? I'm not sure I'd make a connection from django to anything other than a low latency queue.

Yes, but then again so do the underlying mysql connections.

It does use native python sockets, so gevent.monkeypatch would probably work.

Blocking is one of the reasons I use flup and fastcgi - it doesn't matter if one thread of execution blocks; it won't affect any other requests. I've tested this under load with some really gnarly queries, and it works fantastically.

Re: Must-have Django packages

#68

What are people using these days for compiling their static assets (js minification + concatenation, etc)? We have been using django-pipeline but it has been a nightmare.

Why has it been a nightmare? I find it pretty neat. Was using django-compressor earlier but it didn't have support for Python 3.

Re: Must-have Django packages

#69
post #65

Notable omission of South ( http://south.aeracode.org/ )

I think that's because South has been rolled into Django now. Is that correct?

Soon!

Migrations[0] are being included in Django 1.7 which is currently under development. For those unaware, Andrew Godwin, the author of South, ran a successful Kickstarter campaign[1] the fund this effort to incorporate migrations in Django core.

[0] https://docs.djangoproject.com/en/dev/topics/migrations/

[1] http://www.kickstarter.com/projects/andrewgodwin/schema-migr...

Re: Must-have Django packages

#70

What are people using these days for compiling their static assets (js minification + concatenation, etc)? We have been using django-pipeline but it has been a nightmare.

Caveat: Small site, low enough traffic that a few kilobytes per request won't break us.

I just enable gzipping and don't worry about minification of my own assets. Sure, it means larger initial downloads (since they're cached), but it's typically in the single digit kilobytes, and simplifies debugging like nothing else.

Post reply on HN