-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
All static media is run through "collectstatic" #4489
Conversation
This line might hide some problems as well. |
@@ -1,12 +0,0 @@ | |||
<!DOCTYPE HTML> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file does not appear to be used anywhere. I took a look at the commit that added it 6 years ago (38ca662) and most of that code is gone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still trying to understand how our static/media works. So, maybe my questions are irrelevant.
One challenge is that a lot of built documentation still uses /media/
How these docs will behave? Will they fail to load the resources?
Also, I want to raise a question here to anticipate a possible issue: how this will affect the corporate site? It looks that we already have a question there:
media/javascript/underscore.js
Outdated
../../readthedocs/static/vendor/underscore-standalone.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that you just updated the path of the link, but why we are adding static files from our app into the media directory? Shouldn't this be served from the STATICFILES_DIRS
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's two problems:
- Firstly,
collectstatic
actually checks that every symlink resolves. Since/media/static
won't exist if this PR is merged, any symlink referring to there needs updating. - The second problem is that some already built docs refer to paths that are referenced by symlinks. For example,
<script type="text/javascript" src="https://media.readthedocs.org/javascript/underscore.js"></script>
which is in all the built docs relies on this symlink.
As long as we continue to serve the |
I went ahead and tagged this "work in progress". I don't think this PR will get merged as-is. |
I updated this PR to redirect for those resources (eg. |
Another option is to move all the files under |
This doesn't change the STATICFILES_ROOT yet, in an attempt to avoid making any breaking changes. This is a port of #4489 that we'll merge before azure migration
I think the plan with this PR is to merge #4502 first (before the Azure move) and then merge this relatively soon after. |
…atic-collectstatic
I've merged master in after #4502, and now will merge this in. |
This changes how our static files are collected. Rather than
media/
being a directory where static files are served from andcollectstatic
writes tomedia/static
, this turns themedia/
directory into just another entry inSTATICFILES_DIRS
and all static media is collected into a new directorystatic/
.This is a somewhat difficult PR to test thoroughly and it is possible that issues we don't anticipate might arise from it. It makes me a bit nervous to be honest. One challenge is that a lot of built documentation still uses
/media/
(eg./media/javascript/jquery/jquery-migrate-1.2.1.min.js
)