Django Performance Discoveries Part 1

2008-04-26 Thread Prairie Dogg
Hey Everybody, I've been using django for almost a year now and I've been spending some time recently trying to optimize the slicehost VPS(s) that I use to run several django sites I've developed. I wanted to share my findings with the larger group in hopes that my oversights can be pointed out

Re: Queryset-refactor branch has been merged into trunk

2008-04-26 Thread Eric Abrahamsen
Mmmm... model inheritance... multiple OneToOne fields mmm Thanks for all your hard work, Malcolm! Beers are owed to you! On Apr 26, 2008, at 8:30 PM, Prairie Dogg wrote: > > Malcolm: Sorry - it's late over here, didn't mean to mis-type your > name. > > File this and previous under:

Re: Queryset-refactor branch has been merged into trunk

2008-04-26 Thread Prairie Dogg
Malcolm: Sorry - it's late over here, didn't mean to mis-type your name. File this and previous under: damn-life's-work-with-faint-praise On Apr 26, 11:29 pm, Prairie Dogg <[EMAIL PROTECTED]> wrote: > Malcom, > > Thanks so much for your tremendous effort and success on this! > > You rock! > >

Re: Queryset-refactor branch has been merged into trunk

2008-04-26 Thread Prairie Dogg
Malcom, Thanks so much for your tremendous effort and success on this! You rock! On Apr 26, 11:04 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > I merged queryset-refactor into trunk just now. This was changeset > r7477. > > There are still a couple of enhancements to do, but I've decided

Re: Disabling autoescaping when calling render_to_string

2008-04-26 Thread Malcolm Tredinnick
On Sun, 2008-04-27 at 12:37 +0930, Darryl Ross wrote: > James Bennett wrote: > > On Sat, Apr 26, 2008 at 9:38 PM, Darryl Ross <[EMAIL PROTECTED]> wrote: > >> So my question is, is there an argument which will disable auto-escaping? > >> If not, would there be some merit to adding some

Re: Disabling autoescaping when calling render_to_string

2008-04-26 Thread Darryl Ross
James Bennett wrote: On Sat, Apr 26, 2008 at 9:38 PM, Darryl Ross <[EMAIL PROTECTED]> wrote: So my question is, is there an argument which will disable auto-escaping? If not, would there be some merit to adding some functionality that allows this, either as an argument or perhaps to make the

Queryset-refactor branch has been merged into trunk

2008-04-26 Thread Malcolm Tredinnick
I merged queryset-refactor into trunk just now. This was changeset r7477. There are still a couple of enhancements to do, but I've decided they're not worth holding up the entire branch for. I can just as easily do them on trunk. Thanks to everybody who reported bugs and tested things. Thanks

Re: Disabling autoescaping when calling render_to_string

2008-04-26 Thread James Bennett
On Sat, Apr 26, 2008 at 9:38 PM, Darryl Ross <[EMAIL PROTECTED]> wrote: > So my question is, is there an argument which will disable auto-escaping? > If not, would there be some merit to adding some functionality that allows > this, either as an argument or perhaps to make the auto-escaping only

Disabling autoescaping when calling render_to_string

2008-04-26 Thread Darryl Ross
Hi All, I'm using the templating system to send emails, but the templates are being autoescaped. Now, I know I can use {% autoescape off %} in my template files, but the logic I use to build the email body is similar to: template_name = 'emails/generic.txt' if condition1:

Re: Django voting with jellyrool

2008-04-26 Thread Chatchai Neanudorn
*Sorry for confusing,my English is bad also. The problem is django-voting is not provide templatetags to access vote for particular object. Instead it provide templatetags to access only template context variable (Correct me if I'm wrong). See bebow, score_for_object Retrieves

Re: Template Tags Inside 'ifequals'

2008-04-26 Thread Malcolm Tredinnick
On Sat, 2008-04-26 at 11:56 -0700, Szaijan wrote: > I'm trying to create an ifequals tag in a template to check if > request.path equals the URL for a particular view. Either this is not > possible, or I just can't find the right syntax. As I haven't been > able to find an example via Google,

Re: Django voting with jellyrool

2008-04-26 Thread [EMAIL PROTECTED]
What exactly is your problem? Is latest_items empty in the template? On Apr 26, 2:10 am, chatchai <[EMAIL PROTECTED]> wrote: > Hi all, > > I use a modified version ofhttp://jellyroll.googlecode.com/by adding > my own models into follow list (jellyrool.models.Item).  For example, > >

Re: Can Django have unique user homepage?

2008-04-26 Thread Bret W
And that's just one way, of course. On Apr 26, 5:01 pm, Bret W <[EMAIL PROTECTED]> wrote: > Sure. > > You'd need to create a profile model where this information could be > stored.http://www.djangoproject.com/documentation/authentication/#storing-ad... > > You'd then just create forms for

Re: Can Django have unique user homepage?

2008-04-26 Thread Bret W
Sure. You'd need to create a profile model where this information could be stored. http://www.djangoproject.com/documentation/authentication/#storing-additional-information-about-users You'd then just create forms for inputing the parameters you wanted to let users control.

Login issue

2008-04-26 Thread Bret W
I have a login form on my homepage: Username: Password: The homepage uses template fragment caching, but this block is not cached (although I don't know why it couldn't be). I'm not using CSRF middleware. There are many times when I can enter a username and password, click the "login"

Re: File upload with no database - Fantasy or reality?

2008-04-26 Thread python_fan
On Apr 26, 8:13 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > upload_form = None > upload_result = '' > > if request.method == 'POST': > upload_form = FileUploadForm(request.POST, request.FILES) > if upload_form.is_valid(): > # get file name and contents from request: >

Can Django have unique user homepage?

2008-04-26 Thread jmDesktop
Hi, I saw, and please tell me if I am right, the is not self- authentication system that comes with Django. The admin has to create users, groups, etc. I also saw there are people that have developed a user registration module for Django. The next thing that seemed in order was a unique

Template Tags Inside 'ifequals'

2008-04-26 Thread Szaijan
I'm trying to create an ifequals tag in a template to check if request.path equals the URL for a particular view. Either this is not possible, or I just can't find the right syntax. As I haven't been able to find an example via Google, does anyone know hoe to do this correctly? {% ifequals

Re: Unicode broken if using a custom primary key?

2008-04-26 Thread Karen Tracey
On Sat, Apr 26, 2008 at 1:56 PM, plamen.dragozov <[EMAIL PROTECTED]> wrote: > > Hi, > I'm having a realy weird problem. I created Django models for some > legacy data and I'm doing some tests on Windows XP with Django 0.96.1 > and sqlite. > I'm parsing the data (a few big CSV text files) and

Re: File upload with no database - Fantasy or reality?

2008-04-26 Thread Karen Tracey
On Sat, Apr 26, 2008 at 1:18 PM, python_fan <[EMAIL PROTECTED]> wrote: > > > On Apr 26, 3:54 am, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > > > or better still, please paste your full current view and template. > > Also it would be easier to handle the thread if you did not top post ;-) > >

Unicode broken if using a custom primary key?

2008-04-26 Thread plamen.dragozov
Hi, I'm having a realy weird problem. I created Django models for some legacy data and I'm doing some tests on Windows XP with Django 0.96.1 and sqlite. I'm parsing the data (a few big CSV text files) and generating a JSON fixture file, which I use to initialize the database. The file is quite

Re: File upload with no database - Fantasy or reality?

2008-04-26 Thread python_fan
On Apr 26, 3:54 am, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > or better still, please paste your full current view and template. > Also it would be easier to handle the thread if you did not top post ;-) Ok, will do. :) Here is the code: http://dpaste.com/47029/ Thanks a lot, Kenneth!

Caching and comments

2008-04-26 Thread Bret W
This may be exceedingly obvious, but it took me a little bit of Googling for "template fragment caching expiry" before I realized there was an easier way to do what I was looking for. I use template fragment caching (so simple!), but it's annoying when someone comments and his comments don't

Re: Does request.is_ajax() really work?

2008-04-26 Thread Patrick Lv
Oh, thanks Louis. I tried again by using your method. It really works! I mean, request.is_ajax() is working now. Also, I found the real cause why I encountered that problem. I used 'GET' method to request a view in ajax but that view is CACHED by my browser before ajax request it, so I get the

Re: WSGIRequest and is_ajax?

2008-04-26 Thread Malcolm Tredinnick
On Sat, 2008-04-26 at 08:32 -0700, Reinhard Freiler wrote: > > I have written a view in which should return a JSON string or a HTTPResponse, > either the request is ajax or not, so I've tried to check this via the > is_ajax() method > of the request object like it is said in the documentation >

WSGIRequest and is_ajax?

2008-04-26 Thread Reinhard Freiler
I have written a view in which should return a JSON string or a HTTPResponse, either the request is ajax or not, so I've tried to check this via the is_ajax() method of the request object like it is said in the documentation

using Managers in the admin interface

2008-04-26 Thread Explore
Hi. I am new to Django using a recent svn branch on Windows with mysql any python 2.51. I am trying solve the following puzzle: I am trying to override the default behavior of one of my models by using a Manager. My eventual goal is to only allow a certain class of users access to this model

Re: fieldsets in form ( ticket #6630 )

2008-04-26 Thread g m
hai On 4/26/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Hello Django Users, > > I'm a bit struggling with the newforms library, I'm creating multiple > forms where fieldsets need to be defined. I was looking into the > newforms documentation and didn't see anything there about widgets

fieldsets in form ( ticket #6630 )

2008-04-26 Thread [EMAIL PROTECTED]
Hello Django Users, I'm a bit struggling with the newforms library, I'm creating multiple forms where fieldsets need to be defined. I was looking into the newforms documentation and didn't see anything there about widgets creating fieldsets. By searching in google i saw a ticket ( nr 6630 )

Re: possible workarounds for bug #3951 (double invocation of signal handlers)

2008-04-26 Thread Malcolm Tredinnick
On Sat, 2008-04-26 at 14:57 +0200, chris vigelius wrote: > hi, > > trying to work around bug #3951 (http://code.djangoproject.com/ticket/3951), > I've found two possible approaches which both seem to solve my problem (I > send a notification mail in response to the signal and I don't want the

possible workarounds for bug #3951 (double invocation of signal handlers)

2008-04-26 Thread chris vigelius
hi, trying to work around bug #3951 (http://code.djangoproject.com/ticket/3951), I've found two possible approaches which both seem to solve my problem (I send a notification mail in response to the signal and I don't want the mail to be sent twice). The first approach would be to add a flag

Re: FTP upload of files threw django

2008-04-26 Thread [EMAIL PROTECTED]
Thank you all for the responses, I will start looking into it and see if there is a solution for this. I will ask the developer again who saw this once before. Regards, Richard On Apr 26, 10:16 am, pgb <[EMAIL PROTECTED]> wrote: > Hi, > I am also not an expert but personaly I would use

newforms extensions

2008-04-26 Thread [EMAIL PROTECTED]
Hi, We have developed a few extensions to newforms library, and published it for public use. It is more just a simple snippet, so I decided to have a SVN repository and publish it on our website. I've started writing documentation (please tell me if its good enough to start ?):

Re: mod_python or fcgi

2008-04-26 Thread Graham Dumpleton
On Apr 25, 9:47 am, Don Spaulding <[EMAIL PROTECTED]> wrote: > On Apr 24, 6:34 am, Rufman <[EMAIL PROTECTED]> wrote: > > > Hey Graham > > > thanks for the insight > > > Stephane > > I won't debate any of what Graham has said, as it's a pretty standard > answer from what I've seen, and he's a lot

Re: Confused on a foriegnkey error

2008-04-26 Thread Rishabh Manocha
Excuse me for not writing back earlier - travelling isn't always easy. I have however, figured out the cause of this problem and fixed it. I believe it had to do with using ModelMultipleChoiceField instead of ModelChoiceField. Thanks for clearing that up. I will also make a note to be more

Re: Complex Django Hosting

2008-04-26 Thread tupixo
> I'm working on what will end up being a large, high-traffic, multi- > site project. Currently we're just using a basic Webfaction account > for hosting during development and testing, but I'm trying to figure > out what would be the best approach to hosting moving forward. You can probably

Re: FTP upload of files threw django

2008-04-26 Thread pgb
Hi, I am also not an expert but personaly I would use javascript/ajax with files smaller then 100MB, for larger files I would try a Java applet. Either ways use another webserver/s. Please keep us up to date. pawciobiel --~--~-~--~~~---~--~~ You received this

Django voting with jellyrool

2008-04-26 Thread chatchai
Hi all, I use a modified version of http://jellyroll.googlecode.com/ by adding my own models into follow list (jellyrool.models.Item). For example, Item.objects.follow_model(Post) After that, I added django-voting (http://django- voting.googlecode.com/) to my application list. The problem