26
def get_absolute_url(self):
        return "/uploads/%i" % self.id

It's not what I want but This is far as I can think of. I need a link for my files (like.../photo.jpg)

I just learned how to get feeds from my django website. And I want this jpeg's absolute url.

http://myDjangoWeb/uploads/goodies_89087_1211864024_1.jpeg

How can I get this file's absolute url.....self.?????

Ghostino Doggio
  • 351
  • 1
  • 4
  • 11

1 Answers1

54

Just use .url property of the file field.

See "Managing files" in Django documentation.

vartec
  • 131,205
  • 36
  • 218
  • 244