在Google App Engine上捆绑带有应用程序的模块 [英] Bundle module with app on Google App Engine

查看:83
本文介绍了在Google App Engine上捆绑带有应用程序的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个基本问题,但我如何在应用程序中包含模块。

我对Python非常陌生,我想要做的就是包含这个模块 simplejson 与我的应用程序,但下载后,我不知道下一步该怎么做:(



这是

我不知道要将文件移到我的应用程序中。



p> 这是解压后的模块http://img717.imageshack.us/img717/2008 /capturadepantalla201003c.png

解决方案放置 simplejson 目录(即在 simplejson-2.1.0 中)。

simplejson lib与通过执行以下导入任意位置的App Engine捆绑在一起的Django库捆绑在一起:



<$来自dj的p $ p> ango.utils import simplejson

这种方式始终可用,无需在应用中捆绑任何额外的东西。我能想到的唯一缺点是它会过时(尽管我不知道已经过了多久)。


This may be a basic question but how can I include a module with my app.

I'm very new to python and what I want to do is to include this module simplejson with my app, but after downloading it I have no idea what to do next :(

This is how the module looks like after unzip it.

I don't know what files to move to my app.

This is the unzipped module http://img717.imageshack.us/img717/2008/capturadepantalla201003c.png

解决方案

Put the simplejson directory (that is inside the simplejson-2.1.0) in your app.

Or, you could just use the simplejson lib that's bundled with the Django lib that's bundled with App Engine by doing the following import wherever you need it:

from django.utils import simplejson

That's always available, without needing to bundle anything extra with your app. The only drawback I can think of is that it will be out of date (though I don't know how far out of date).

这篇关于在Google App Engine上捆绑带有应用程序的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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