Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

The django-admin app is supposed to open a popup window when I try to create a related object. For example, clicking the green plus button here:

enter image description here

Should bring a new pop-up window, where I can create a new related (in this case Session) object. However, when I click the green plus button, the object create opens up in the same window, instead of a pop-up window. This is a problem, because if a user starts to create a primary object, then half-way through, clicks the green plus, he will lose all the progress on the primary object. This means that the green plus is unusable.

I have no idea why this is happening. I understand that I am not providing a minimum example of the problem, because I haven't been able to construct one. Right now I want to diagnose the problem. Any ideas of how I can diagnose this? And fix it?

I can provide any information you think is necessary.

Related: Django admin popup links are broken. But he's using Grappelli, which I am not. I am using the default django admin interface.

I am using Django version 1.8.4.

UPDATE: The popups work fine with manage.py runserver. The problem only appears with the deployed version under apache. I hope this narrows down the issue.

On google groups: https://groups.google.com/forum/#!topic/django-users/awYelJjFjHk.

like image 932
becko Avatar asked Oct 17 '15 17:10

becko


1 Answers

I wasn't able to produce a minimal example of what was going on, but it is fixed now. Essentially, I did the following:

  1. Upgraded to Django 1.8.6 .
  2. Ran python manage.py collectstatic (as suggested in https://community.webfaction.com/questions/18544/there-is-not-popup-window-for-one-to-many-relationship-with-djangos-admin-v18)

So in the end I'm not sure what the issue was. I hope this is useful to someone else.

If someone else comes up with a more complete answer, which involves a minimal example and with an explanation of what was going on, I'll be glad to change the accepter answer.

like image 144
becko Avatar answered Sep 29 '22 01:09

becko