title: django get media url in view function
body: <p>Serve Media File in view function </p>
  
  <p>View.py</p>
  
  <pre><code>file_path = Tracks.objects.get(pk=event_id)
  name = file_path.file.name
  fullpath = os.path.abspath(name)
  </code></pre>
  
  <p>When i perform above function, the fullpath is throwing below error :</p>
  
  <pre><code>[Errno 2] No such file or directory: '/home/ri/studio/videotube/uploads/2014/10/15/Wildlife_512kb_hVnnOc2.mp4'
  </code></pre>
  
  <p>But the actual file live in <code>file:///home/ri/studio/videotube/videotube/site_media/media/uploads/2014/10/15/Wildlife_512kb_hVnnOc2.mp4</code></p>
  
  <p>This is my media root <code>MEDIA_ROOT = os.path.join(PACKAGE_ROOT, "site_media", "media")</code></p>
  
  <p>What should i do for getting media url in view function ?</p>