Sorry if this is a tad off topic...

I have Django 0.95 up and running with no problems under Apache2 with
flatpages installed and also running fine.

I have limited uploads by adding the setting LimitRequestBody 5242880
to the httpd.conf file, which works great. If I try to upload a large
file I get this in the error.log:
[Fri Dec 01 11:08:28 2006] [error] [client 127.0.0.1] Requested
content-length of 8627377 is larger than the configured limit of
5242880, referer: http://127.0.0.1/doc/create/

I want Apache to send the user to a nice error page if this happens.

So, I created a nice error page using flatpages with the url:
/413error/
I tested it by typing in: http://127.0.0.1/413error/ in the address bar
of the browser and I get the nice error message.

The next thing I did was set: ErrorDocument 413 /413error/ in the
httpd.conf file hoping that Apache would send the user to the desired
URL but I get a message in Firefox stating: "The connection to the
server was reset while the page was loading."

I also tried a simple ErrorDocument 413 "The file is too big" and this
did not work either.

I'm tapped out, could someone please give me a hint as to what I am
missing here?

Thanks in advance.

PS I have been restarting Apache after every change to the httpd.conf
file.

References:
http://httpd.apache.org/docs/trunk/mod/core.html#errordocument
http://httpd.apache.org/docs/trunk/mod/core.html#limitrequestbody

My additions to httpd.conf for Django:

# Changed MaxRequestsPerChild 0 to 1 for Django
<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild  1
</IfModule>

Alias /media/ "C:/idms_project/idms/media/"

<Location "/media/">
    SetHandler None
</Location>

ErrorDocument 413 /413error/

LimitRequestBody 5242880

<Location "/">
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    PythonPath "['C:\idms_project'] + sys.path"
    SetEnv DJANGO_SETTINGS_MODULE idms.settings
    PythonDebug On
</Location>


--~--~---------~--~----~------------~-------~--~----~
 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to