Re: Custom Http404 like exception

2013-02-18 Thread Serge G. Spaolonzi
Thanks, It worked. On Mon, Feb 18, 2013 at 1:00 PM, Tom Evans wrote: > On Mon, Feb 18, 2013 at 2:41 PM, Serge G. Spaolonzi > wrote: > > Thanks Pankaj, In this case I could not use an HttpResponse because the > > helper method I am developing doesn't return a respose it returns a dict > or > >

Re: Custom Http404 like exception

2013-02-18 Thread Tom Evans
On Mon, Feb 18, 2013 at 2:41 PM, Serge G. Spaolonzi wrote: > Thanks Pankaj, In this case I could not use an HttpResponse because the > helper method I am developing doesn't return a respose it returns a dict or > raises an exception if the user is not authenticated. > For example: > > def get_ser

Re: Custom Http404 like exception

2013-02-18 Thread Serge G. Spaolonzi
Thanks Pankaj, In this case I could not use an HttpResponse because the helper method I am developing doesn't return a respose it returns a dict or raises an exception if the user is not authenticated. For example: def get_server_time(request): time_dictionary = helper_method() #Rest

Re: Custom Http404 like exception

2013-02-18 Thread Pankaj Singh
Hey Serge, Here is a brief description of how status code is set in request response cycle of Django. *Http404* inherits from *Exception* defined here - https://github.com/django/django/blob/1.4.3/django/http/__init__.py#L132-L133 *get_response() method of django.core.handlers.base.BaseHandler h