For whatever reason, after many hours of troubleshooting, I cannot seem to insert a local static file into a template or raw html with "img src". An image via a web url renders fine. Here are the relevant details:
Ownership of files is of the main user. Images are in the user's home folder and have r/w permission (same as all the executable scripts that work fine). The server output reports: "GET /images/image.jpg HTTP/1.1" 200 Web browser shows the default browser placeholder image, as if it knows it should be there but doesn't have access to it. view.py (tried many variations of the following): from django.contrib import staticfiles <img src="/abs/path/to/folder/image.jpg" class="img-responsive"> <img src="static/image.jpg" class="img-responsive"> <img src="image.jpg" class="img-responsive"> # (The above is an insert for the template) index.html (the template): {% load static %} # at the top <img src="{{ STATIC_URL }}/image.jpg" class="img-responsive"> # The above would have been in the insert in view.py but for testing I tried the template also and it still doesn't work. settings.py: # Static files (CSS, JavaScript, Images) STATIC_ROOT = os.path.join(os.path.dirname(__file__), 'static') STATIC_URL = '/static/' STATICFILES_DIR = ['/path/to/project/images/', '/path/to/project/static/'] # Also tried absolute paths above and parenthesis instead of brackets for STATICFILES_DIR. I have run manage.py collectstatic, although I think that only applies to apps. There is just a project folder, no apps. Restarting the server after every change. Not sure where to go from here. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6d1bbfcd-469a-49a3-a00c-2baa132ae57f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.