title: Page not found 404 for media url, getting images name from database Django 3.0.1
body: <p>This is my project folders</p>
  
  <p><img src="https://i.stack.imgur.com/ehWJq.png" alt="Project Folders"></p>
  
  <p>I first decided to set my media url and my media root on my settings.py </p>
  
  <pre><code>MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  MEDIA_URL = '/media/portfoliopicture/'
  </code></pre>
  
  <p>On my admin side, I decided to give it an url pattern in local, since I tho while I am in local it wouldnt be able to get my URL <em>"I wasnt sure at all since on the documentation nothing was talking about url pattern"</em></p>
  
  <pre><code>if settings.DEBUG:
  urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
  </code></pre>
  
  <p>I have define my model this way.</p>
  
  <pre><code>image = models.ImageField(upload_to='portfoliopicture/')
  </code></pre>
  
  <p>And using the url to get the image,</p>
  
  <pre><code>src="{{ portfolio.image.url }}"
  </code></pre>
  
  <p>Inside my template html, this is how i call it, This issue I am getting is so weird, It's like it isnt able to find the url path..</p>
  
  <p>This is the message error I am getting. coming from the network tab
  <img src="https://i.stack.imgur.com/EMXJP.png" alt=""></p>
  
  <p>I would like to understand. Why am I having this issue when the url seems to be defined. Is it an issue with the way I'm calling the folders? I am clearly missing something here. </p>
  
  <p><a href="https://i.stack.imgur.com/5zHB5.png" rel="nofollow noreferrer">this happen when i add the prefix manually</a></p>
  
  <pre><code> src="portfoliopicture/{{ portfolio.image.url }}"
  </code></pre>