一种无需访问互联网即可部署Django的简便方法? [英] An easy way to deploy Django without Internet access?
问题描述
我所拥有的是Intranet网站的开发版本,该网站是使用Django和放置在virtualenv中的一些外部库开发的。它运行良好,我可以在具有Internet连接的任何计算机上轻松地使用相同的参数(使用pip)设置virtualenv。但是,不幸的是,它需要在没有:(的任何方式来处理此事的情况下部署在计算机上?在此先谢谢您。
What I have is development version of intranet site developed with Django and some external libraries placed in virtualenv. It runs fine and I can easily set up virtualenv with the same parameters (using pip) on any computer with internet connection. But, unfortunately it needs to be deployed on computer without :( Any way to deal with this? Thanks in advance.
推荐答案
< s>您可以创建PIP包。
更新:自1.5版起,不推荐使用pip捆绑包并将其从PIP中删除
Update: pip bundle has been deprecated, and removed from PIP since version 1.5
对于PIP 1.5,您应该改为
With PIP 1.5 you should instead create local cache of the packages.
- 下载软件包:
pip install --download< DIR> -r要求.txt
- 使用它们:
pip install --no-index --find-links =< DIR> -r要求。 txt
- download packages:
pip install --download <DIR> -r requirements.txt
- use them:
pip install --no-index --find-links=<DIR> -r requirements.txt
替代方法是使用 wheel
软件包:
Alternative is to use wheel
packages:
- 安装
轮
(如果尚未安装)pip安装轮
- 下载软件包:
pip wheel- -wheel-dir =< DIR> -r requirements.txt
- 使用它们:
pip install --use-wheel --no-index --find-links = < DIR> -r requirements.txt
- install
wheel
if you don't have it alreadypip install wheel
- download packages:
pip wheel --wheel-dir=<DIR> -r requirements.txt
- use them:
pip install --use-wheel --no-index --find-links=<DIR> -r requirements.txt
这篇关于一种无需访问互联网即可部署Django的简便方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!