通过将文件夹放置在 python 路径中来使用 Crypto? - Python

发布于 2024-09-06 13:51:54 字数 237 浏览 3 评论 0原文

我使用 Django 来提供 Web 服务。我目前只能访问 FTP 和代码刷新。无法访问命令行或执行任何类型的可执行文件。

我使用的是 Windows Server 2005 机器。

我可以通过将文件夹放在我的 Django 项目中来使用 Crypto 吗?

如果没有的话,有什么好的替代方案吗?


帮助将会很棒!

I'm using Django in order to serve a web service. I have only access to FTP and code refresh at the moment. No access to command-line or executing any kind of executable.

I am using a Windows Server 2005 machine.

Would I be able to use Crypto just by placing the folder within my Django project?

Are there any good alternatives if not?


Help would be amazing guys!!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

调妓 2024-09-13 13:51:54

在上传之前,您需要构建 pycrypto。这需要在环境与服务器尽可能相似的计算机上完成。

要构建,请从 pycrypto-2.1.0 目录中运行 python setup.py build 。这将创建 build\lib.win32-2.6\Crypto (libxxx 目录的名称可能有点不同)。

Crypto 文件夹通过 FTP 传输到服务器 Python 路径上的某个位置。在 Django 项目文件夹内可能有效,也可能无效。一个安全的选择是将其放在您的 site-packages 文件夹中(如果您有权访问它)。

我对 Windows 上的部署不太了解,但通常每当进行任何更改时都需要重新启动服务器以重新加载应用程序。希望这就是您所说的“代码刷新”的意思

You'll need to build pycrypto before you upload it. This will need to be done on a machine with as similar an environment to your server as possible.

To build, run python setup.py build from inside the pycrypto-2.1.0 directory. This will create build\lib.win32-2.6\Crypto (the name of the libxxx directory might be a little different).

FTP the Crypto folder to somewhere on your server's python path. Inside the Django project folder may or may not work. A safe bet is to put it right in your site-packages folder, if you have access to it.

I don't know much about deploying on Windows, but usually you need to restart the server to reload the application whenever you make any changes. Hopefully that's what you meant by 'code refresh'

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文