Django admin 添加相关对象不打开弹出窗口? [英] Django admin add related object doesn't open popup window?

查看:17
本文介绍了Django admin 添加相关对象不打开弹出窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试创建相关对象时,django-admin 应用程序应该会打开一个弹出窗口.比如点击这里的绿色加号按钮:

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:

应该会带来一个新的弹出窗口,我可以在其中创建一个新的相关(在本例中为 Session)对象.但是,当我单击绿色加号按钮时,对象创建会在同一窗口中打开,而不是弹出窗口.这是一个问题,因为如果用户开始创建主对象,然后在中途点击绿色加号,他将丢失主对象上的所有进度.这意味着绿色加号无法使用.

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.

相关:Django 管理弹出链接已损坏.但他正在使用 Grappelli,而我不是.我使用的是默认的 django 管理界面.

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

我使用的是 Django 版本 1.8.4.

I am using Django version 1.8.4.

更新:弹出窗口与 manage.py runserver 一起工作正常.该问题仅出现在 apache 下的已部署版本中.我希望这能缩小问题的范围.

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.

在 google 群组上:https://groups.google.com/forum/#!topic/django-users/awYelJjFjHk.

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:

  1. 升级到 Django 1.8.6 .
  2. 运行 python manage.py collectstatic(如 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 admin 添加相关对象不打开弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆