Basically, let's say I have an image in /home/arnav/Documents/covers. My django project directory is /home/arnav/project. Is it possible for django to somehow access image files in covers and use them as part of a template? Or do images need to be stored within the project to be accessed? Thanks.
-
You can make your web server and filesystem do anything you like.Ignacio Vazquez-Abrams– Ignacio Vazquez-Abrams2014-08-31 00:47:45 +00:00Commented Aug 31, 2014 at 0:47
Add a comment
|
1 Answer
In your settings file define STATICFILES_DIRS to also include the /home/arnav/Documents/covers path:
STATICFILES_DIRS = (
'/home/arnav/project/static',
'/home/arnav/Documents/covers',
)
This will tell django to first look in the project static directory, but also look in covers for static files.