title: Django 1.6 image upload and media path
body: <p>So I have a project on webfaction where I need to create two different environments, one to server django and one to server static files.</p>
  
  <p>So when I upload an image from admin panel I can see the image is placed in root i defined but with full path. When i return the image in my view i get my domain.com/full/media/root/path/imagename</p>
  
  <p>this generates a broken link - when i go to mydomain.com/uploads/image_name, I can see image file is there however my link is pointing to full path rather than root_url, </p>
  
  <p>Could you please help me with this? I really dont understand how i can correct this image link in my view </p>
  
  <pre><code>&lt;img src="{{ MEDIA_URL }}{{ mymodel.my_image }}" alt="{{ name }}" width="150" height="200" /&gt;
  </code></pre>
  
  <p>I do understand there are so many subjects similar to this here however none of them could direct me correctly in regards to how to hide or change path root to "uploads"</p>
  
  <p>I have which works fine in my admin</p>
  
  <pre><code>class Movie(models.Model):
  
  name = models.CharField(max_length=50)
  
  
  def get_file_path(instance, filename):
      ext = filename.split('.')[-1]
      filename = "%s.%s" % (uuid.uuid4(), ext)
      return os.path.join( '/home/user/webapps/project/uploads/' , filename)
  
  
  my_image = models.ImageField(upload_to = get_file_path, null=True, blank=True)
  def __unicode__(self):
      return self.name
  </code></pre>
  
  <p>In my settings: </p>
  
  <pre><code>MEDIA_ROOT = '/home/user/webapps/project/uploads/'
  MEDIA_URL = '/uploads/'
  </code></pre>
  
  <p>and project url:</p>
  
  <p>from django.conf.urls import patterns, include, url
  from django.conf import settings</p>
  
  <pre><code>  from django.contrib import admin
    admin.autodiscover()
  
    urlpatterns = patterns('',      
      url(r'^admin/', include(admin.site.urls)),
    )
  
  
  if settings.DEBUG:
  urlpatterns += patterns('',
  (r'^uploads/(?P&lt;path&gt;.*)$', 'django.views.static.serve', {
  'document_root': settings.MEDIA_ROOT}))
  </code></pre>
  
  <p>Thank you all in advance</p>