scipy / SciPyCentral

SciPy Central
http://scipy-central.org
BSD 3-Clause "New" or "Revised" License
16 stars 12 forks source link

Uploaded image media file URL not rendered correctly #177

Closed ksurya closed 9 years ago

ksurya commented 10 years ago

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 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.

ksurya commented 9 years ago

The domain name is now not used. i.e, we use relative URLs not absolute from now on.