title: Suspicious Operation Django
body: <p>I've been running into a problem while trying to delete uploaded images.</p>
  
  <p>The error is along these lines:</p>
  
  <pre><code>SuspiciousOperation: Attempted access to '/media/artists/12-stones/154339.jpg' denied.
  </code></pre>
  
  <p>After reading around it looks like the error is due to the fact that it's looking for the image in the wrong place (notice first slash, /media/ doesn't exist on the filesystem)</p>
  
  <p>My MEDIA_ROOT and MEDIA_URL are: </p>
  
  <pre><code>MEDIA_ROOT = '/home/tsoporan/site/media/'
  MEDIA_URL = "/media/
  </code></pre>
  
  <p>My models upload_to parameter is passed this function:</p>
  
  <pre><code>def get_artist_path(instance, filename):
    return os.path.join('artists', slugify(instance.name), filename)
  </code></pre>
  
  <p>My questions are:</p>
  
  <p>1) How can I fix this problem for future uploads?</p>
  
  <p>2) Is it possible to fix my current images' paths without having to reupload?</p>
  
  <p>Regards, 
  Titus</p>