title: Django - uploading static image as default ImageField file
body: <p>This is my models.py:</p>
  
  <pre><code>def get_profileImage_file_path(instance, filename):
      return os.path.join('%s/uploadedPhotos/profileImages' % instance.user_id, filename)
  
  class UserExtended(models.Model):
      user = models.OneToOneField(User)
      profileImage = models.ImageField(upload_to=get_profileImage_file_path, default='/static/images/myProfileIcon.png')
  </code></pre>
  
  <p>Now, I want the default image (which is in my static folder) to save to the path given in the</p>
  
  <pre><code>get_profileImage_file_path
  </code></pre>
  
  <p>function. In my settings.py, I have defined media_root and media_URL as:</p>
  
  <pre><code>MEDIA_ROOT = '/home/username/Documents/aSa/userPhotos'
  
  MEDIA_URL = '/media/'
  </code></pre>
  
  <p>For some reason, when I pass the user object in the template and in the template, if I do:</p>
  
  <pre><code>&lt;img class='profilePic' src="{{ user.userextended.profileImage.url }}" height='120px' alt="" /&gt; 
  </code></pre>
  
  <p>No image shows up and when I open up the 'inspect element' section in chrome, it gives a 404 error saying:</p>
  
  <pre><code>GET http://127.0.0.1:8000/home/username/Documents/djcode/aS/aSa/static/images/myProfileIcon.png 404 (NOT FOUND)  
  </code></pre>
  
  <p>even though that is the correct file path to the image. (I'm also not sure why it's giving the entire file path, isn't it just supposed to start from /static/? Even when I 'view source', the entire url is there.) How do I make it so that the default image which is located in the static folder uploads to the path provided in the</p>
  
  <pre><code>get_profileImage_file_path
  </code></pre>
  
  <p>function?</p>