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

fix collectstatic command when using ManifestStaticFilesStorage #148

Merged
merged 1 commit into from
Jul 9, 2024
Merged

fix collectstatic command when using ManifestStaticFilesStorage #148

merged 1 commit into from
Jul 9, 2024

Conversation

anneFly
Copy link
Contributor

@anneFly anneFly commented Jul 4, 2024

Description:

Since version 0.5.0. our project doesn't build anymore because it fails during collectstatic.
This PR fixes it for me, but I'm not sure of any other side effects this change could have. So, if you decide this PR is not the right way to fix the issue, I'd appreciate a different solution because we can't upgrade to 0.5.0 atm.

How to reproduce:

With a fresh django project that has django-map-widgets version 0.5.0 installed, add this to the settings:

STATICFILES_STORAGE = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"

Then try to run python manage.py collectstatic.
You will get an error like this:

ValueError: The file 'mapwidgets/css/magnific-popup.css.map' could not be found with <django.contrib.staticfiles.storage.ManifestStaticFilesStorage object at 0x7fc7fb525e20>.

Possible future improvements:

It might be worth having a CI check that runs collectstatic with different STATICFILES_STORAGE settings. (If you'd like a contribution, I might be able to give it a shot but not anytime soon.)

@erdem
Copy link
Owner

erdem commented Jul 4, 2024

Hi @anneFly

Thank you for your PR.

I integrated the latest version of the package into a fresh Django project just a few days ago and didn't encounter any failures during the collectstatic execution.

if you upgraded 0.4.2 version to 0.5.0,you may better to run collectstatic with clear argument.

python manage.py collectstatic --clear

It might be didn't fail in my setup because STATICFILES_STORAGE setting difference in my project. I will try to reproduce this issue.

It might be worth having a CI check that runs collectstatic with different STATICFILES_STORAGE settings. (If you'd like a contribution, I might be able to give it a shot but not anytime soon.)

noted.

Thanks

@vnagendra
Copy link

This is the same issue discussed here also codyfletcher/django-jazzmin-fork#1 and I can confirm that we are seeing this as well.

@erdem erdem merged commit 0df6e2b into erdem:main Jul 9, 2024
1 check passed
@erdem
Copy link
Owner

erdem commented Jul 9, 2024

Thanks @anneFly and @vnagendra, I have just published the new release.

pip install django-map-widgets==0.5.1

@vnagendra
Copy link

Thank you for the timely merge/release! I was poking around to revert my changes to go back to the previous version when I saw this! Great job maintaining the project...

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

Successfully merging this pull request may close these issues.

3 participants