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

Hashed filenames not being updated #819

Open
chrisspen opened this issue Aug 22, 2024 · 0 comments
Open

Hashed filenames not being updated #819

chrisspen opened this issue Aug 22, 2024 · 0 comments

Comments

@chrisspen
Copy link

If I run:

manage.py collectstatic --noinput

Pipeline correctly generates the collected, minimized and hashed file in my static folder. e.g. /static/js/index.59efce78ac06.js

However, the {% javascript 'index_js' %} template tag does not generate the corresponding filename. The hash it uses seems to get stuck on the last hash and never updates to the one just generated. I have to kill and restart runserver for it to use the new hash.

This only seems to happen when DEBUG=False, so it's not a problem in development. However, this is a huge problem for a production environment, because it means you have to restart your Django process every single time you update your static media and run collectstatic.

My pipeline settings are:

PIPELINE = {
    'CSS_COMPRESSOR': 'pipeline.compressors.cssmin.CSSMinCompressor',
    'JS_COMPRESSOR': 'pipeline.compressors.jsmin.JSMinCompressor',
    'PIPELINE_ENABLED': True,
    'PIPELINE_COLLECTOR_ENABLED': True,
    'STYLESHEETS': {
        'global_css': {
            'source_filenames': (...),
            'output_filename':
            'css/global.css',
            'extra_context': {
                'media': 'screen,projection',
            },
        },
        'index_css': {
            'source_filenames': (...,),
            'output_filename': 'css/index.css',
            'extra_context': {
                'media': 'screen,projection',
            },
        },
    },
    'JAVASCRIPT': {
        'index_js': {
            'source_filenames': (...,),
            'output_filename': 'js/index.js',
        }
    },
}

STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage'

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'pipeline.finders.PipelineFinder',
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant