开发者

An easy way to deploy Django without Internet access?

开发者 https://www.devze.com 2023-03-02 11:58 出处:网络
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 (us

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 ad开发者_C百科vance.


You can create PIP bundle.

Update: pip bundle has been deprecated, and removed from PIP since version 1.5

With PIP 1.5 you should instead create local cache of the packages.

  1. download packages: pip install --download <DIR> -r requirements.txt
  2. use them: pip install --no-index --find-links=<DIR> -r requirements.txt

Alternative is to use wheel packages:

  1. install wheel if you don't have it already pip install wheel
  2. download packages: pip wheel --wheel-dir=<DIR> -r requirements.txt
  3. use them: pip install --use-wheel --no-index --find-links=<DIR> -r requirements.txt
0

精彩评论

暂无评论...
验证码 换一张
取 消