I'm getting the error when I add the tag '{% load staticfiles %}' in my html page. Following is the wsgi.py configuration. I tried the answer given in this forum for a similar issue, but when I make changes to wsgi.py like that, then I get the error 500, something went wrong when I launch the html page. Could you help to solve. Note: I'm able to use Python2.7/Django1.8 with Xampp in my laptop and able to display images with same code. Kindly help to resolve.
/ > var > www > learnweb_pythonanywhere_com_wsgi.py import os import sys
add your project directory to the sys.path
project_home = u'/home/learnweb' if project_home not in sys.path: sys.path.append(project_home)
set environment variable to tell django where your settings.py is
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
serve django via WSGI
import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
/ > home > learnweb > mysite > myapp > templates > sdff.html <html> <head> <title> Financial Freedom </title> </head>
<body>
{% load staticfiles %} <img src="{% static "wealth.jpg" %}" alt = "My image"/> <img src="wealth.jpg"/>