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

Revert "Remove SelectiveFileSystemFolder finder workaround" #4533

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions readthedocs/core/static.py
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals

from django.contrib.staticfiles.finders import FileSystemFinder


class SelectiveFileSystemFinder(FileSystemFinder):

"""
Add user media paths in ``media/`` to ignore patterns.

This allows collectstatic inside ``media/`` without collecting all of the
paths that include user files
"""

def list(self, ignore_patterns):
ignore_patterns.extend(['epub', 'pdf', 'htmlzip', 'json', 'man', 'static'])
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to remove static here or we will have problems in dev.

return super(SelectiveFileSystemFinder, self).list(ignore_patterns)
4 changes: 4 additions & 0 deletions readthedocs/settings/base.py
Expand Up @@ -176,6 +176,10 @@ def USE_PROMOS(self): # noqa
os.path.join(SITE_ROOT, 'readthedocs', 'static'),
os.path.join(SITE_ROOT, 'media'),
]
STATICFILES_FINDERS = [
'readthedocs.core.static.SelectiveFileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
]

TEMPLATES = [
{
Expand Down