'django admin popups are broken when using 'collect static', what might be the problem?

When I try to press + on a many-to-many or foreign-key or any field like that, it usually gives me a popup window. Now it's just redirecting me to URL.../model/add/?_to_field=id&_popup=1 which complicates everything.

I read and tried these posts, but none of them helped:

Django admin add related object doesn't open popup window?

https://github.com/sehmaschine/django-grappelli/issues/600

Django admin popup links are broken

After experimenting with Django, I found out that only happens when you use python manage.py collectstatic

When you delete everything from the static folder, it gets fixed. What might be the problem?

I'm not using any special thing, I made a fresh boilerplate Django application, added 2 models, and ran collect static, and it still happened.

Django version: 4.0.3 Python version: 3.10.2 Pip version: 22.0.4



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source