只能将Python .pyc文件部署到Google App Engine? [英] Can I deploy Python .pyc files only to Google App Engine?

查看:239
本文介绍了只能将Python .pyc文件部署到Google App Engine?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Google App Engine上的Django开发一个项目。我被问到是否有部分代码可以部署为只编译。



所以我猜问题是我可以上传一个只包含该片段的.pyc文件的代码?我已经在应用程序中完成了一个带有views.pyc文件的基本测试,但事情不起作用。是否有一些配置或其他可以设置允许Google App Engine只使用.pyc文件?

解决方案

我意识到当您提出这个问题时,您无法做到这一点,但现在您可以使用Python 2.7。请参阅 Python 2.7中的沙盒


您可以上传并使用 .pyc ,但不能与 .py 文件。您可以上传包含 .py .pyc 文件(或组合)的zip文件。



I'm working on a project utilizing Django on Google App Engine. I've been asked if some of the code can be deployed as compiled only.

So I guess the question is can I upload a .pyc file only that contains the piece of code in question? I've done a basic test with a views.pyc file in an application and things don't work. Is there some configuration or other that I can set to allow Google App Engine to just use the .pyc files?

解决方案

I realise you couldn't do this when you asked this question, but you can now, if you use Python 2.7. See Sandboxing in Python 2.7:

You can upload and use .pyc, but not in combination with .py files. You can upload zip files containing .py or .pyc files (or a combination).

这篇关于只能将Python .pyc文件部署到Google App Engine?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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