Reputation: 2122
I wanted to know how is it possible in django to bind an already uploaded file (stored in the file system of server) to a Model FileField. This way I want to have my edit page of that model to prepopulate the FileField with this file.
Thanks
Upvotes: 1
Views: 749
Reputation: 2122
Well I found the answer. It was quite easy actually. you just need to set the FileField value to some string and it will point to that file.
The point is that the path specified should be correct otherwise you get a 404 error when trying to access it.
Upvotes: 3