小编len*_*nny的帖子

完全删除带有点符号的django应用程序

我想django.contrib.comments从我正在处理的项目中删除该应用程序.我试过了:

$ python manage.py sqlclear django.contrib.comments
Run Code Online (Sandbox Code Playgroud)

在shell上但得到了:

错误:找不到标签为django.contrib.comments的应用.您确定您的INSTALLED_APPS设置是否正确?

我仔细检查了我的INSTALLED_APPS设置,确实django.contrib.comments存在.

有关如何绕过这个的任何建议?

python django

6
推荐指数
1
解决办法
122
查看次数

AttributeError:'Nonetype'对象没有属性'_info'

我正在研究一个Django项目,当我尝试运行任何管理命令时会出现此错误,例如: python manage.py validate --settings ord.settings.development,python manage.py syncdb --settings ord.settings.development.该项目使用Django 1.5的错误是:AttributeError: 'Nonetype' object has no attribute '_info'.没有给出其他输出.

项目基础设置文件是:https://gist.github.com/anonymous/5c0fede63b2724d7880b

开发设置:https://gist.github.com/anonymous/f60b90dcf573b0a7b920

我用的是替换了敏感设置 x

知道什么可能是错的吗?

一些额外的信息,当我注释掉LANGUAGE_CODE的设置,一些命令一样validate,runserver,shell运行良好,但syncdbmigrate失败,错误:DatabaseError: current transaction is aborted, commands ignored until end of transaction block

追溯:https://gist.github.com/anonymous/bc3364ae5ba511566871

python django

6
推荐指数
2
解决办法
5711
查看次数

Bootstrap 模态对话框按钮单击事件在模态打开时触发

我正在开发一个应用程序,需要打开一个modal,让用户填写一些详细信息并在他们单击我指定的模式按钮后保存它们。我曾经为按钮jQuery on绑定一个click事件。问题是当模态打开时触发点击事件。

模态相关部分:

<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">Close</a>
<a href="#" class="btn btn-primary" id="save-event">Save Event</a>
Run Code Online (Sandbox Code Playgroud)

我在哪里绑定事件:

$('#save-event').on(
'click',
function(evt)
{
    console.log('triggered');
}
);
Run Code Online (Sandbox Code Playgroud)

当我打开对话框时,控制台显示“已触发”。我通过以下方式打开对话框:

<a href="#add-event-modal" role="button" class="btn" data-toggle="modal">{% trans "Event also occurs on" %}</a>
Run Code Online (Sandbox Code Playgroud)

它是一个 Django 应用程序,所以花括号。任何想法我可能做错了什么,或者一旦用户单击相关按钮是否有另一种方法来执行某些逻辑?

html javascript jquery twitter-bootstrap

2
推荐指数
1
解决办法
6万
查看次数

标签 统计

django ×2

python ×2

html ×1

javascript ×1

jquery ×1

twitter-bootstrap ×1