摘要: 1, 导入 MongoDBManagerfrom django_mongodb_engine.contrib import MongoDBManager2. 在models 中的Article加入objects = MongoDBManager()3. 开始更新。Article.objects.raw_update({"_id": ObjectId(object_id_input)}, {"$push": {"comments": {"_id":comment_id, ... 阅读全文
posted @ 2012-04-08 15:47 文刀无尽 阅读(2033) 评论(0) 推荐(0) 编辑
摘要: 框架:phonegap.利用phonegap 的plungin 取到图片数据 ,加到json中,利用jquery的ajax提交到服务器端,在服务器端解析并保存图片。但打开图片时,出现图片已被破坏的提示。或者有时候,提示json中有特殊字符。试验N次后再是这样,后来发现image data 中的+号及=号,在json的传递过程中,也处处理掉了,于是在javascript encode一样,问题解决。 阅读全文
posted @ 2012-04-04 07:55 文刀无尽 阅读(446) 评论(0) 推荐(0) 编辑
摘要: 上网google了一大堆,都说是django-nonrel 没有正确安装的问题。反复重新安装django-nonrel也没解决,把django-nonrel下的django覆盖到目录/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages还是不行,在仔细看报的错后,发现在目录 /Library/Python/2.7/site-packages下还有一个django,将这个覆盖后,it's work. 阅读全文
posted @ 2012-03-18 12:12 文刀无尽 阅读(361) 评论(0) 推荐(0) 编辑
摘要: sudo installer -pkg /Volumes/someapp/someapp.mpkg -target / 阅读全文
posted @ 2012-03-17 15:57 文刀无尽 阅读(498) 评论(0) 推荐(0) 编辑
摘要: This article is a little more up to date with the changes made by Hostmonster / Bluehost, and to make the instructions a little more clear, and simplified.1. Download the MongoDB binaries – You want to download thelegacy-staticproduction release. Hosmonster / Bluehost run Linux 64-bitDownloadI found 阅读全文
posted @ 2012-03-16 18:39 文刀无尽 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 出于前期用户不多,而且是部署在bluehost,出于简单考虑,用数据库代替rabbitmq.安装先安装django-kombu:$ pip install -U django-kombu配置可以直接使用原来的DATABASES数据库设置。设置 broker transport:BROKER_URL = "django://" 添加到INSTALLED_APPS:INSTALLED_APPS = ("djkombu", ) 验证数据库设置:DATABASE_ENGINE = "mysql" DATABASE_NAME = "m 阅读全文
posted @ 2012-03-06 15:50 文刀无尽 阅读(968) 评论(0) 推荐(0) 编辑
摘要: It all depends on what you want to use it for.RabbitMQ is the recommended solution, it is widely deployed, tested and supports all features. With optimized configuration you can process up to 15000 persistent tasks/s with a single process. RabbitMQ also comes with management and monitoring solutions 阅读全文
posted @ 2012-03-06 14:40 文刀无尽 阅读(1151) 评论(0) 推荐(0) 编辑
摘要: 第一步,当然是先连接到shell上,先在cpanel的ssh/shell上启动shh.我是用mac连的,打开terminal ,敲入:ssh 你在bluehost用户名@你的域名,然后再输入密码,就可以链接了。==以下是网上搜下来的安装步骤。After Idiscovered the presence of Python 2.6on BlueHost, they decided to remove this installation by default. Fortunately it’s really simple to build Python from sources and insta 阅读全文
posted @ 2012-03-02 18:44 文刀无尽 阅读(550) 评论(0) 推荐(0) 编辑
摘要: In order to have a splash screen in a PhoneGap Android application you need to put your splash.png file into res/drawable-ldpi, res/drawable-mdpi, res/drawable-hdpi, res/drawable-xdpi. Where those directories represent low, medium, high and extra large dots per inch. You'll need to resize you sl 阅读全文
posted @ 2012-02-17 00:14 文刀无尽 阅读(443) 评论(0) 推荐(0) 编辑
摘要: 我用phonegap+jquery架构,在iphone的模拟器,android 2.1模拟器,还有真机2.1上都可以得到数据。 但在我的一台小米2.3上拿不到数据,查了半天不知道什么原因,也差点去写java 的xmlhttprequest 插件, 最后发现原来是加载页面的timeout时间问题。 在 super.loadUrl("file:///android_asset/www/index.html"); 上加如下代码: super.setIntegerProperty("loadUrlTimeoutValue", 70000); 阅读全文
posted @ 2012-02-10 23:59 文刀无尽 阅读(311) 评论(0) 推荐(0) 编辑