lundi 20 février 2017

Django show image/video which is outside of static folder

I want to make web site which show file tree in web and print image/video on web.
I'm planning to print it with html tag img and video. However there are some problems with path. Most of my static files( like video or img) outside of django project folder.
For example django template source and view source is at /Users/Knight/My-site/Damotorie_cafe/views.py and image is at /Applications/MAMP/practice
I tried to get relative path with python code and use it for src attribute.
Same path works well when I don't use django and just open it with local web browser, however when I open it with django then error occur.

I'm starter in django. Can any one help me? (I searched it before asking, but most of question is about upload not show image.)




Aucun commentaire:

Enregistrer un commentaire