On Thu, Jan 7, 2010 at 3:46 PM, Finity <paul.zaczkow...@gmail.com> wrote:
> I am getting a 500 server error when I try to submit (via "POST") a > certain form. The form is built like so: > > CATEGORY_CHOICES = ( > ('desktop', 'Desktop Computer'), > ('laptop', 'Laptop Computer'), > ('printer', 'Printer'), > ('phone', 'Phone'), > ('other', 'Other') > ) > > class WorkorderForm(forms.Form): > """Create a form for submitting workorders. > """ > category = forms.ChoiceField(choices=CATEGORY_CHOICES) > model_number = forms.CharField() > serial_number = forms.CharField(label="Serial number/Service tag") > room_number = forms.CharField() > problem_desc = forms.CharField(widget=forms.Textarea(), > label="Problem Description") > > When I remove the 'category' field, it works perfectly fine. I also > have two other forms that are nearly identical to this one (without > ChoiceFields, just TextFields, and one contains a URL Field) that work > perfectly. > > Any idea why this would be? I find it strange that even with > Debug=True on, I'm still getting my *servers* 500 error. The apache > access_log just reads: > > I assume you mean DEBUG=True? Case matters. > "POST /tech/workorders/ HTTP/1.1" 500 59595 "https:// > insider.springisd.org/tech/workorders/" "Mozilla/5.0 (Windows; U; > Windows NT 5.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6" > > That line reports 59595 bytes in the 500 response. That's a humongous number of bytes for a basic Apache server error page, it looks more correct for a Django debug page, really. Based on that I believe Django did generate a debug page, I've got no idea why that isn't what you see. Have you tried running under the dev server just to see what happens there? I don't see anything wrong with the form. Cut and pasting it as-is and using it in a trivial template/view works. So the problem is likely in the code you have that processes the posted form data. Karen--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.