Django 1.1 returns 500 instead of 404 in non-debug mode

2009-07-30 Thread prabhu S
Hi All, I am not noticing a weird issue in django 1.1. When DEBUG is true in settings and if I try a non-existent url, django shows me a friendly 404 page. Now I create 404.html and 500.html and place this in templates directory. Then If I turn off debug and try a non-existent url, I expect to

Re: Long Poll in Django

2009-07-30 Thread prabhu S
long poll, push ajax, comet wow too many names for this!!! It will be interesting to study http://code.google.com/p/pygowave-server/ and find out how they implement this. Regards, Prabhu On Jul 30, 10:52 am, aleph wrote: > Hi! > > Is it possible to use Django with longpoll

Re: Django 1.1 returns 500 instead of 404 in non-debug mode

2009-07-30 Thread prabhu S
would appreciate if you can take a look at settings.py and let me know if something is obvious. Thanks & Regards, Prabhu On Jul 30, 2:25 pm, Karen Tracey <kmtra...@gmail.com> wrote: > On Thu, Jul 30, 2009 at 8:40 AM, prabhu S <prabhu...@gmail.com> wrote: > > > Hi All, >

Re: Django 1.1 returns 500 instead of 404 in non-debug mode

2009-07-30 Thread prabhu S
approve of what you say, but I will defend to the death your > right to say it." -- Voltaire > > > > > > prabhu S wrote: > > Hi Karen, > > > Thanks for replying. I have put my 404.html in the same place as that > > of500.html. To make sure, I even co

Thoughts on many-to-many relationship

2009-07-31 Thread prabhu S
Hi All, When I try to create a Group (django.contrib.auth.models.Group) dynamically, I get the below error. 'Group' instance needs to have a primary key value before a many-to- many relationship can be used. This is because I am trying to add permissions to the group object and trying to save

Re: Django newbie deployment question

2009-08-01 Thread prabhu S
Your apache server would run as www user. Where as you have saved your project in /root with root as the owner. To do this properly, do not save your django project in /root. Have it somewhere like /var/www and make "www" as the owner. Also fix execute permissions. chmod -R 700 should do. Or

Re: modelform validation errors

2009-08-01 Thread prabhu S
The method create_profile returns profile after saving. But this object will not contain primary keys etc generated in the db. To work around this common issue with django profile.save() # Get the data again from db. profile = Profile.objects.get(user=username) return profile Let me know if

Re: Log in problem

2009-08-01 Thread prabhu S
I think this should fix. Additionally if you are using render_to_response for some reason, it passes Context instead of RequestContext. To solve this do render_to_response('view', {}, context_instance=RequestContext(request)) On Aug 1, 9:10 pm, OIM wrote: > You should use:

Re: Python Conditional help

2009-08-01 Thread prabhu S
change student_id_validate to student_id_check Invalid variable dude. On Aug 2, 12:46 am, cprsystems wrote: > I'm trying to redirect users of an html page to another page depending > on the user id entered. I'm using if else statements and declaring ids > within views.py

Re: Python Conditional help

2009-08-01 Thread prabhu S
Also declare dan_id and stu_id as string. Unless request.GET can magically return you number, which I am not sure. Looks we are doing compilers job here :) On Aug 2, 1:17 am, Alex Gaynor <alex.gay...@gmail.com> wrote: > On Sat, Aug 1, 2009 at 6:59 PM, prabhu S<prabhu...@gmai

Re: cab snippet add gives error

2009-08-03 Thread prabhu S
Appears like a data type mismatch. Are you entering some string value in a integer field or something of that sort? On Aug 3, 12:45 pm, andreas schmid wrote: > hi, > > im trying to build the cab code sharing app with the practical django > projects book, at the moment i

Re: Receiving email, similar to Rails

2009-08-03 Thread prabhu S
Not sure whether this is possible out of the box yet. But here is some starter. http://code.google.com/p/jutda-helpdesk/source/browse/trunk/management/commands/get_email.py jutda-helpdesk project as a whole should be a good reference. On Aug 3, 4:14 pm, Brandon Taylor

Re: how to, complex filters in admin

2009-08-03 Thread prabhu S
Right. If you are looking for more complex queries take a look at Q http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects On Aug 3, 6:40 pm, selcukcihan wrote: > I need to get the filtering criteria from the request, is that right? > > On

Re: Django on Hostmonster shared hosting

2009-08-03 Thread prabhu S
in mysite.fcgi fix the settings file name. os.environ['DJANGO_SETTINGS_MODULE'] = "mysite.settings" Your settings file is inside a directory called "mysite". It will help if you quickly take a look at modules documentation in python. Also your fcgi complains about several missing parameters.

Re: Using email instead of username in extended "User" model?

2009-08-03 Thread prabhu S
Going a step backward, why cant you make username same as email. Have a custom login_required decorator that uses email and password to authenticate, override registeration pages and not show username field? It seems to work for me. On Aug 2, 4:38 pm, Dana wrote: >

Re: Recursive request and page layout

2009-08-09 Thread prabhu S
It will be awesome if you can make and open source such a tag. Shouldn't be hard since templates can be evaluated independent of http. If you want something simpler, use iframe and point it to the correct url. Regards, Prabhu On Aug 8, 12:11 pm, SardarNL wrote: > I've

Re: weirdist situation I have faced in 4 years of (ab)using django

2009-08-09 Thread prabhu S
Hi KG, Nice to meet you! How are you confirming if the data is from Meeting? Are you looking at the final rendered html? What does a print after the statement p = Event.objects.get(pk=id) tell you? Also check if you have just one view for the particular url mapping. Regards, Prabhu On Aug 9,

Re: Standalone script with django's ORM and multiprocessing

2009-08-11 Thread prabhu S
Solution appears like a hack to me. Why do you close the connection in every process? Can you not just close once in parent? Execute commits alone in each process. On Aug 11, 10:50 am, Spajderix wrote: > Malcolm Tredinnick pisze: > > > > > On Tue, 2009-08-11 at 11:06 +0200,