python - Storing uploaded dynamic media in Django -
python - Storing uploaded dynamic media in Django -
i'm making blog django, , i'm wondering should store photos go along articles. should media folder go within articles app, or in main project folder? seems should go within app if want add together more functionality app, can have own media folder , maintain them separate. however, since have add together media_root, seems things set media has go same place. case, or not understanding correctly? can assign multiple media_roots?
the 'correct' way have stored in media_root
, , each filefield
specify own sub directory using upload_to
keyword argument.
the reason want stored in single media_root
folder configuring web server serve files statically simple- 1 configuration directive serve entire folder (rather having configure serving files multiple locations).
python django
Comments
Post a Comment