The media URL for image to display is rendered incorrectly. It renders full URL of the image file without http or https at the beginning. The current path rendered as
domain_name + relative_media_url
But this has to start with http or https instead when we are rendering full path including domain name.
Since domain_name comes from django.contrib.sites.models.Site object's 'domain` field, we can simply insert the missing string in there but it may not be a good practice.
I'm not sure but the current deployment may have been done this way.
Reference: Module:
scipy_central.rest_comments.views.setup_compile_dir
https://github.com/scipy/SciPyCentral/blob/master/scipy_central/rest_comments/views.py#L56
The media URL for image to display is rendered incorrectly. It renders full URL of the image file without
http
orhttps
at the beginning. The current path rendered asdomain_name + relative_media_url
But this has to start with
http
orhttps
instead when we are rendering full path including domain name.Since
domain_name
comes fromdjango.contrib.sites.models.Site
object's 'domain` field, we can simply insert the missing string in there but it may not be a good practice.I'm not sure but the current deployment may have been done this way.