Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » File upload from python client to Django app [RSS Feed]

#1 June 21, 2010 15:52:17

s.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

File upload from python client to Django app


Hello to all,

I'm trying to do a POST from a python client to a Django webapp using
urllib2 but I'm getting http 403 error.
On the Django side I'm using a Form so I suspect the problem is {%
csrf_token %} (csrf middleware enabled) which I can't provide from the
client side.

Is there other way to do this?

Your advice is much appreciated,
Regards,
Sorin


--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 June 21, 2010 15:56:19

e.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

File upload from python client to Django app


urllib2 can handle cookies and therefore you should be able to handle
the login. It will probably be a fair bit of work to get the client to
submit the various parts, but I'm sure I've seen some examples around
on how to do such a thing.

Euan

On Jun 21, 3:52 pm, srn <tso...@gmail.com> wrote:
> Hello to all,
>
> I'm trying to do a POST from a python client to a Django webapp using
> urllib2 but I'm getting http 403  error.
> On the Django side I'm using a Form so I suspect the problem is {%
> csrf_token %} (csrf middleware enabled) which I can't provide from the
> client side.
>
> Is there other way to do this?
>
> Your advice is much appreciated,
> Regards,
> Sorin

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » File upload from python client to Django app [RSS Feed]

Board footer

Moderator control

Enjoy the 15th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support