0

I have set:

MEDIA_URL='/media/'
MEDIAFILES_DIRS = [os.path.join(BASE_DIR, "media_in_pro")]

I have a directory media_in_pro in base directory of project and within this i have directory called "profile" like "media_in_pro/profile/image.jpeg". I have added in my urls static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) to URL_PATTERS.

My problem is when I try to access this image in template like this:

img src="{% media 'profile_image/profile.jpg' %}"

then it raises TemplateSyntaxError because of this media. It does not recognize "media" in img tag.While my static files are working fine and i have used same method for my static files. While i am using static in the same way without any problem. Can anyone help me in sorting this out?

Natalie Hedström
  • 2,607
  • 3
  • 25
  • 36
user2719152
  • 939
  • 3
  • 11
  • 20

0 Answers0