简体   繁体   English

通过将文件夹放在python路径中使用加密? -Python

[英]Using Crypto by placing folder in python path? - Python

I'm using Django in order to serve a web service. 我正在使用Django来提供Web服务。 I have only access to FTP and code refresh at the moment. 目前,我只能访问FTP和代码刷新。 No access to command-line or executing any kind of executable. 无法访问命令行或执行任何类型的可执行文件。

I am using a Windows Server 2005 machine. 我正在使用Windows Server 2005计算机。

Would I be able to use Crypto just by placing the folder within my Django project? 仅通过将文件夹放在Django项目中就能使用Crypto吗?

Are there any good alternatives if not? 如果没有,是否有其他好的选择?


Help would be amazing guys!!! 帮助将是惊人的家伙!

You'll need to build pycrypto before you upload it. 上传之前,您需要先构建pycrypto。 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. 要构建,请从pycrypto-2.1.0目录中运行python setup.py build This will create build\\lib.win32-2.6\\Crypto (the name of the libxxx directory might be a little different). 这将创建build\\lib.win32-2.6\\Crypto (libxxx目录的名称可能有所不同)。

FTP the Crypto folder to somewhere on your server's python path. Crypto文件夹通过FTP传输到服务器python路径上的某个位置。 Inside the Django project folder may or may not work. 在Django专案资料夹中,可能会或可能无法运作。 A safe bet is to put it right in your site-packages folder, if you have access to it. 如果可以访问,安全的选择是将其放在您的site-packages文件夹中。

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. 我对在Windows上进行部署的了解不多,但是通常在进行任何更改时都需要重新启动服务器以重新加载应用程序。 Hopefully that's what you meant by 'code refresh' 希望这就是“代码刷新”的意思

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM