0

This is well known topic, on how to setup, serve MEDIA Files, but there is a lot of no no to serving them in production, this is just one example from answered question on SO,

Django does not serve MEDIA_ROOT by default. That would be dangerous in production environment. But in development stage, we could cut short. Pay attention to the last line. That line enables Django to serve files from MEDIA_URL. This works only in developement stage

Obviously there is a lot of web application that are handling this, I have a field in which I'm expecting a lot of CV to be uploaded, my concern are corrupted files, so is there a common pattern on how to handle this?

Community
  • 1
  • 1
copser
  • 2,523
  • 5
  • 38
  • 73
  • So, what are you asking? The question you link to has nothing to do with serving media files in production, although as that comment states you need to configure your web server to do it. And what would causing "corruption"? – Daniel Roseman Nov 25 '16 at 21:21
  • Well partially you have answered my question on "to configure your web server", the corruption will cause users, maybe someone can upload some corrupted file – copser Nov 25 '16 at 21:29

1 Answers1

1

What you are saying is recommended against, but if you would like to anyways, there is a package called dj-static that does exactly what you are asking.

dj-static on Github

Hybrid
  • 6,741
  • 3
  • 25
  • 45