一种无需访问互联网即可部署Django的简便方法? [英] An easy way to deploy Django without Internet access?

查看:100
本文介绍了一种无需访问互联网即可部署Django的简便方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我所拥有的是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.


  1. 下载软件包: pip install --download< DIR> -r要求.txt

  2. 使用它们: pip install --no-index --find-links =< DIR> -r要求。 txt

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

替代方法是使用 wheel 软件包:

Alternative is to use wheel packages:


  1. 安装(如果尚未安装) pip安装轮

  2. 下载软件包: pip wheel- -wheel-dir =< DIR> -r requirements.txt

  3. 使用它们: pip install --use-wheel --no-index --find-links = < DIR> -r requirements.txt

  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

这篇关于一种无需访问互联网即可部署Django的简便方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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