title: Cannot download file from Django under local dev mode
body: <p>I'm trying to download a file from Django under local development mode. I tried to follow lots of Stackoverflow posts and here is my code of doing so.</p>
  
  <pre><code>class AutoPushView(View):
      def get(self, request, eventId):
          fileName = '/Users/tommy/DjangoProject/mysite/static/python.png'
          mimeType, _ = mimetypes.guess_type(fileName)
          response = HttpResponse(open(fileName, 'rb'), content_type=mimeType)
          response['Content-Disposition'] = "attachment; filename=%s" % os.path.basename(fileName)
          return response
  
  </code></pre>
  
  <p>And I have my urls.py and settings.py as following</p>
  
  <pre><code># urls.py
  urlpatterns = [
      path('&lt;str:eventId&gt;/autopush', views.AutoPushView.as_view(), name='autopush'),
  ]
  </code></pre>
  
  <pre><code># settings.py
  STATIC_URL = '/static/'
  
  STATICFILES_DIRS = [
      os.path.join(BASE_DIR, "static"),
      '/Users/lbc/DjangoProject/mysite/static/',
  ]
  </code></pre>
  
  <p>When I invoke the view from a browser (press a HTML button), there's no error shown but the download action is not triggered. What am I missing here? </p>