title: Able to upload file but non retrieve/diplay them - Page not found
body: <p>I am creating a website in Django and Postgres where a user can answer multiple questions and upload some PDFs.</p>
  
  <p>I am able to upload the PDF but not to display it. I want the user to be able to click on a link, and a new webpage opens containing the PDF.</p>
  
  <p>In my <strong>details.html</strong> I wrote the code:</p>
  
  <pre><code>&lt;a href="{{ MEDIA_URL }}{{project.thirdquestiondetail.third_seven.url}}"&gt;Click here to see the file&lt;/a&gt;
  </code></pre>
  
  <p>But, if the user clicks on the links, he gets this messages:</p>
  
  <p><a href="https://i.stack.imgur.com/9bE8N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9bE8N.png" alt="Error"></a></p>
  
  <p>I have the following:</p>
  
  <p><strong>mysite/urls.py</strong></p>
  
  <pre><code>from django.contrib import admin
  from django.urls import path, include
  from django.views.generic.base import TemplateView
  from django.conf import settings
  from django.views.static import serve
  from django.conf.urls.static import static
  
  urlpatterns = [
      path('', TemplateView.as_view(template_name='home.html'), name='home'),
      path('conditions/', TemplateView.as_view(template_name='conditions.html'), name='conditions'),
      path('admin/', admin.site.urls),
      path('users/', include('users.urls')),
      path('users/', include('django.contrib.auth.urls')),
      path('projects/', include('projects.urls')),
  ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
  </code></pre>
  
  <p><strong>mysite/settings.py</strong></p>
  
  <pre><code>STATICFILES_DIRS = [
      os.path.join(BASE_DIR, 'mysite/static/')
  ]
  
  STATIC_ROOT = os.path.join(BASE_DIR, 'static')
  STATIC_URL = '/static/'
  
  MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  MEDIA_URL = '/media/'
  </code></pre>
  
  <p>As said, I am pretty sure the PDF is uploaded. In fact, if I login as superuser in the admin panel, I can see the PDF.
  <a href="https://i.stack.imgur.com/MtiGf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MtiGf.png" alt="Admin panel"></a></p>
  
  <p><strong>HOWEVER</strong> if I click it, I get the same 404 error reported above </p>
  
  <p>I think the error is in my <strong>settings.py</strong> when I definied my <code>/media/</code>. So I checked several similar questions but it seems my settings are in line with the chosen answers.</p>