Cumbersome object creation

2005-12-30 Thread Wojtek/brandlay.com
So i did: def MyModel(meta.Model): foo = meta.ForeignKey(Foo) bar = meta.ForeignKey(Bar) added = meta.Date(auto_add_now = True) mod = MyModel() mod.foo_id = 1 mod.bar_id = 2 mod.save() And it did not work, saying that my object has no 'id' attribute. Why would it have an 'id' attribute since

More fine-grained select_related

2005-12-30 Thread Wojtek/brandlay.com
Often I want to select some related objects in get_list(), but select_related only allows to traverse the reference tree right to the bottom of it. Would it be hard to have select_related either be set to True if one wants to select the whole tree, or be set to the names of relations that one wan

Re: Cumbersome object creation

2005-12-31 Thread Wojtek/brandlay.com
Why not fix it then? :)

No way to get the requested hostname in a portable way

2006-01-17 Thread Wojtek/brandlay.com
I want to get the full URL of the current request, and there seems to be no portable way to do it (no Request object method). request.META['HOSTNAME'] works for getting the host when django is started with the builtin webserver, but doesn't work with the fcgi backend. Is this feature planned? I

speeding Django up

2006-02-02 Thread Wojtek/brandlay.com
any idea how to speed Django up? my servers have load 140 now even though I'm caching templates. any sites/hints on speading the whole machinery up? the thing that generates the most load are the templates it seems. a profile session result is below, all hints are welcome :) 9787 fun

Re: speeding Django up

2006-02-02 Thread Wojtek/brandlay.com
I'm caching the unrendered templates, so there is no filesystem/parsing overhead. It's only executing python code related to template rendering which is making it slow. I can't really cache template output since it varies a lot depending on who is viewing it. Anyone tried using psyco or similia

Re: speeding Django up

2006-02-02 Thread Wojtek/brandlay.com
Sure, below is the tag which I use for including a template. The template which is included is cached by my caching mechanism. I've just noticed that the caching mechanism only caches the innermost template in the inheritance tree. So the templates from which I inherit are reparsed at each requ

Re: speeding Django up

2006-02-03 Thread Wojtek/brandlay.com
OK I've ran Django with psyco and hit it with 50 requests, here are the results: without psyco: 265822 function calls (207471 primitive calls) in 3.547 CPU seconds with psyco: 66865 function calls (63420 primitive calls) in 1.457 CPU seconds So basically - if you want a quick D

Re: speeding Django up

2006-02-03 Thread Wojtek/brandlay.com
efuly someone will add it to the trunk :) I'm going to test it on all my pages in a minute and then enable on all my servers. Maybe the load will go down to 50 from 100 now :) Jacob Kaplan-Moss wrote: > On Feb 3, 2006, at 6:46 AM, Wojtek/brandlay.com wrote: > > without psyco:

Re: speeding Django up

2006-02-03 Thread Wojtek/brandlay.com
Ok I gave psyco a try, and it works OK speeding things up 2 times as benchmarked. My OS is 32bit, running on 64bit machines so probably that's why I didn't run into the bug you're describing Jacob. I had issues with the whole thing hanging on one machine, either because of the SVN FLUP version o

Re: speeding Django up

2006-02-04 Thread Wojtek/brandlay.com
Good idea Victor. After a couple hours the backends got 150MB large each and the whole thing put the server down. So what I'll do is make sure the backends die after serving a couple thousand of requests. This should make me safe from such errors. I can't just ignore a 100% increase in performa

'Rotating' the fcgi backends.

2006-02-16 Thread Wojtek/brandlay.com
I want to exit() a backend after it has processed a certain number of requests via FCGI (WSGI?). Any idea how to do it cleanly with Django? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group.