WebFaction
Community site: login faq

I am trying to upload user generated media .

The form i'm using and the realted code is : def shirt_form(req): if req.POST:

    form = UploadShirtForm(req.POST, req.FILES)
    if form.is_valid():
        form.save()
        c = Context({'item':(form.save())})
        t = get_template('doneAdding.html')
        print "Done Adding To Database"
        return HttpResponse(t.render(c))
else:
    form = UploadShirtForm()
    c = Context({'form':form})
    t = get_template('addShirtform.html')
    return render_to_response('addShirtform.html', context_instance=RequestContext(req,{'form':form}))

class UploadShirtForm(forms.ModelForm): class Meta: model = models.Shirts

i have a static app to deliver media and a sym link which i refer to in order to upload the media from the user.

Whenever i try to access the form it shows an internal server error with the usual 500 code. Any clue on why this might be happening? I dont know if this is a problem with the media uploads or something to do with the form. The whole thing works fine on the django development server.

asked 02 Apr '14, 15:51

Arjun Krishna
12
accept rate: 0%

You mention that you get a 500 Error. Can you tell us the specific error message that's appearing in your logs as a result?

Also, putting your application into Debug mode may provide even more information for debugging.

(03 Apr '14, 08:01) ryans ♦♦

form = UploadShirtForm(req.POST, req.FILES)
    if form.is_valid():
        form.save()
        c = Context({'item':(form.save())})
        t = get_template('doneAdding.html')
        print "Done Adding To Database"
        return HttpResponse(t.render(c))
else:
    form = UploadShirtForm()
    c = Context({'form':form})
    t = get_template('addShirtform.html')
    return render_to_response('addShirtform.html', context_instance=RequestContext(req,{'form':form}))
class UploadShirtForm(forms.ModelForm): class Meta: model = models.Shirts

i have a static app to deliver media and a sym link which i refer to in order to upload the media from the user.

Whenever i try to access the form it shows an internal server error with the usual 500 code. Any clue on why this might be happening? I dont know if this is a problem with the media uploads or something to do with the form. The whole thing works fine on the django development server.

permanent link

answered 13 Aug '14, 04:33

cltrigg888
111
accept rate: 0%

edited 13 Aug '14, 07:31

ryans ♦♦
5.0k93160

What's the actual error message (from your logs)?

(13 Aug '14, 07:33) ryans ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×908
×29
×26
×9

question asked: 02 Apr '14, 15:51

question was seen: 1,758 times

last updated: 13 Aug '14, 07:33

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM