Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the STATIC_URL for static files to avoid redirection #4522

Merged
merged 3 commits into from Aug 21, 2018

Conversation

@davidfischer
Copy link
Contributor

@davidfischer davidfischer commented Aug 14, 2018

This PR cleans up a few areas that were using MEDIA_URL but really should be using STATIC_URL after #4489. The old URL will work but will result in a redirect which slows things down and results in an extra hit.

@davidfischer davidfischer requested a review from Aug 14, 2018
Copy link
Member

@ericholscher ericholscher left a comment

Looks good. Just want to make sure we aren't breaking backwards compat, at least for now.

Loading

@@ -79,7 +76,7 @@ context = {
'html_theme': html_theme,
'current_version': "{{ version.verbose_name }}",
'version_slug': "{{ version.slug }}",
'MEDIA_URL': "{{ settings.MEDIA_URL }}",
Copy link
Member

@ericholscher ericholscher Aug 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably continue to pass this along, in case anyone else is depending on it.

Loading

Copy link
Member

@humitos humitos Aug 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case we keep passing it, may be a good idea to have a comment saying that it's not need and should be removed but it's kept for compatibility reasons.

BTW, how we "deprecate" and communicate something like this? It's too small to worth a blog post, I think.

Loading

Copy link
Contributor Author

@davidfischer davidfischer Aug 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update this to keep the MEDIA_URL. I think we'll just keep it and detail any deprecation as part of https://docs.readthedocs.io/en/latest/design/theme-context.html.

Loading

- This may be removed when the new theme context is implemented
https://docs.readthedocs.io/en/latest/design/theme-context.html
@davidfischer
Copy link
Contributor Author

@davidfischer davidfischer commented Aug 15, 2018

I re-added the MEDIA_URL back.

Loading

@davidfischer davidfischer merged commit 9ee283c into master Aug 21, 2018
1 check passed
Loading
@davidfischer davidfischer deleted the davidfischer/media-to-static-cleanup branch Aug 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants