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 collectstatic on `media/`, without collecting user files #4502

Merged
merged 3 commits into from Aug 14, 2018

Conversation

Projects
None yet
3 participants
@agjohnson
Contributor

agjohnson commented Aug 9, 2018

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

agjohnson added some commits Aug 8, 2018

Use collectstatic on `media/`, without collecting user files
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
@davidfischer

This is close but I think we just need one change.

os.path.join(SITE_ROOT, 'media'),
]
STATICFILES_FINDERS = [
'readthedocs.core.static.SelectiveFileSystemFinder',

This comment has been minimized.

@davidfischer

davidfischer Aug 10, 2018

Contributor

I didn't know you could do that. Seems useful!

@davidfischer

davidfischer Aug 10, 2018

Contributor

I didn't know you could do that. Seems useful!

STATICFILES_DIRS = [os.path.join(SITE_ROOT, 'readthedocs', 'static')]
STATICFILES_DIRS = [
os.path.join(SITE_ROOT, 'readthedocs', 'static'),
os.path.join(SITE_ROOT, 'media'),

This comment has been minimized.

@davidfischer

davidfischer Aug 10, 2018

Contributor

This still seems a bit weird to me to collect files from a path (/media) and put them in a subdirectory (/media/static) but I guess it's ok with the SelectiveFileSystemFinder.

@davidfischer

davidfischer Aug 10, 2018

Contributor

This still seems a bit weird to me to collect files from a path (/media) and put them in a subdirectory (/media/static) but I guess it's ok with the SelectiveFileSystemFinder.

This comment has been minimized.

@agjohnson

agjohnson Aug 10, 2018

Contributor

Yeah agreed. I only worry that there are some deep parts requiring the media path, as this pattern goes back to early django I believe. If we run into any weirdness here, I think we can probably justify taking on work to separate static.

@agjohnson

agjohnson Aug 10, 2018

Contributor

Yeah agreed. I only worry that there are some deep parts requiring the media path, as this pattern goes back to early django I believe. If we run into any weirdness here, I think we can probably justify taking on work to separate static.

Show outdated Hide outdated readthedocs/core/static.py Outdated

@ericholscher ericholscher merged commit 5f993a0 into master Aug 14, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@stsewd stsewd deleted the agj/test-add-media-collection branch Oct 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment