Tuesday, July 9, 2013

Re: Problem in uploading MultiValueDictKeyError

You have
Csrf_token% {%}

shouldn't it be

{% csrf_token %}

???






On 9 July 2013 13:10, Hélio Miranda <helio13m@gmail.com> wrote:
Good!
I'm having a strange problem, which is this, I have uploaded all ok and working.
HTML:
  <! doctype html>
<html>
   <head>
   <title> {% block title%} {% endblock%} </ title>
   </ head>
   <body>
{% Block content%} {% endblock%}
  <form enctype="multipart/form-data" method="post">
  Csrf_token% {%}
<input type="file" id="file" name="file" multiple=""/>
<tr> <td> <button type="submit" class="btn"> Submit </ button> </ td> </ tr>
   </ body>
</ html>

Views:
def upload (request, id):

     if request.method == 'POST':
        
         my_painting Movie.objects.get = (id = id)
                
         files = []
         request.FILES.getlist for f in ('file'):
            mf = mongoengine.fields.GridFSProxy ()
            mf.put (f, filename = f.name)

            files.append (mf)
            my_painting.MovieCover = files
         my_painting.save ()

     return render_to_response ('upload.html', {},
                               context_instance = RequestContext (request))

But to put my code in the repository to my colleague interconnect interface, the pc it gives the following error:
MultiValueDictKeyError at / upload/51dbdc3efadcd20d8cad9249
'Key' Legend 'not found in <QueryDict: {u'csrfmiddlewaretoken': [u'ttink2Z7gz3VXu1CwruYeZ2Cnq5x7uNy']}> "

Does anyone know what could be?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate