Paul Childs wrote: > It looks like I am going down the wrong path. I think that what I > observed was by design since Django is handling the request. > > I think the question should be... > > How do I handle the 413 error within Django? > > Any help would be greatly appreciated. > > You'll likely want Django to return the 413 error code. Fortunately, it's easy to alter headers of HttpResponce objects. See the docs[1]. Actually, you should be able to alter the status code like so: response = HttpResponce (YOURTEMPLATE) response.status_code = 413 return response
As long as YOURTEMPLATE correctly renders a template you created to display the error message (perhaps with context), that should do the trick. You may find the code for other error codes interesting as well [2]. [1]: http://www.djangoproject.com/documentation/request_response/#httpresponse-objects [2]: http://code.djangoproject.com/browser/django/trunk/django/http/__init__.py --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---