[Answer]-To use an existing file for an external operation using Django

1👍

Answer 1:
You forgot the closing paranthesis to join on the line above.

It should be:

open(os.path.join(settings.MEDIA_ROOT, '/media/file.txt'), 'r').read()

Answer 2: You can use httplib to upload a file (i.e. via POST request). Check out the example here (it’s short and sweet):

http://code.activestate.com/recipes/146306/

👤Gabe

Leave a comment