Caching compiled templates

2006-05-04 Thread WSobczuk
i hooked up a simple template cache in django/core/: - in loader.py I proxy get_template (and cache by name) - in loader_tags.py I cache inside ExtendsNode.get_parent (the find_template_source and get_template_from_string calls just like in loader.py) but when I enabled the cache it came out that

Re: Selecting one related object.

2006-02-08 Thread WSobczuk
Ok if I do it with handmade SQL then I'm rewriting the DB abstraction layer since I have to do it for several models inheriting from a common base model..

Selecting one related object.

2006-02-07 Thread WSobczuk
Let's say I have a model: User (name = CharField()) and model Bulletin (body = CharField(), user = ForeignKey(User)) and so I want to fetch a bunch of bulletins and the related user information. My case is a lot more complex than this and I can't use select_related (since that seems to be fetchi

Template cache which speeded up my setup 25 times

2006-01-25 Thread WSobczuk
Hey, On my hosts doing several hundred requests per second the load was at 100 already, and then Adrian suggested to cache the templates. So I implemented a simple cache (which is now a hack but perhaps it will be included in Django soon) which brought the load down to 5 - so a lot of speedup at

Re: Debugging a production app

2006-01-07 Thread WSobczuk
I'm not saying I wnat to send information to users, I'm saying I want it logged (at least to stdout is it *that* hard?). And I'm not keen on putting down my email server when I publish some broken code and get 1 error emails. Email isn't a means of error reporting - logs are. And digging th

Re: Debugging a production app

2006-01-07 Thread WSobczuk
Did I mention that it's the *PRODUCTION* environment? And I can't just 'activate DEBUG', I want the error to be logged whenever it happens and. Besides, once DEBUG=False i want to know what's going on on my servers too and not have to turn debug on and reproduce the error which is ridiculous. p

Debugging a production app

2006-01-07 Thread WSobczuk
Hey, I'm having a lot of problems with Django not printing error messages when errors happen. For example: 1. if the error 500 template is missing - django just prints 'template missing', and doesn't print the actual error that caused the problem. 2. if i do make an error 500 template i don't k