Django管理员添加相关对象不打开弹出窗口? [英] Django admin add related object doesn't open popup window?
问题描述
当我尝试创建一个相关对象时,django-admin应用程序应该打开一个弹出窗口。例如,点击绿色加号按钮:
<应该带一个新的弹出窗口,在那里我可以创建一个新的相关(本例中为Session)对象。但是,当我单击绿色加号按钮时,对象创建在同一窗口中打开,而不是弹出窗口。这是一个问题,因为如果一个用户开始创建一个主要对象,那么半途而废,点击绿色加号,他将失去主要对象的所有进度。这意味着绿色加号是不可用的。
我不知道为什么会发生这种情况。我明白,我没有提供这个问题的最小例证,因为我没有能够构建一个。现在我想要诊断问题。有什么想法我怎么诊断这个?并且修复它?
我可以提供您认为必要的任何信息。
相关: Django管理弹出链接已损坏。但他正在使用Grappelli,我不是。我正在使用默认的django管理界面。
我正在使用Django版本1.8.4。
更新:弹出窗口可以使用 manage.py runserver
正常工作。问题只出现在apache下部署的版本。我希望这会缩小问题。
在Google群组中: https://groups.google.com/forum/#!topic/django-users/awYelJjFjHk 。
我无法生成发生的最小例子,但现在已经修复了。本质上,我做了以下工作:
- 升级到Django 1.8.6。
- c $ c> python manage.py collectstatic (如 https://community.webfaction.com/questions/18544/there-is-not-popup-window-foroneone -to-many-relationship-with-djangos-admin-v18 )
所以最后我不是确定问题是什么。我希望这对其他人有用。
如果有人提出了一个更完整的答案,其中涉及到一个最小的例子,并说明了发生了什么,我很乐意改变接受者的答案。
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:
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.
I wasn't able to produce a minimal example of what was going on, but it is fixed now. Essentially, I did the following:
- Upgraded to Django 1.8.6 .
- 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.
这篇关于Django管理员添加相关对象不打开弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!