基于 Django 的网站的好方法,如果需要安装先决条件

发布于 2024-09-16 07:31:53 字数 178 浏览 3 评论 0原文

考虑使用 python 和 django 构建网站。在许多情况下,它使用标准 python 库旁边的第 3 方模块 - 例如 pytz、South、时区或调试工具栏。

将此类应用程序部署到生产托管并自动安装所有先决条件(时区等)的标准或便捷方法是什么?

我是 python 新手,如果这个问题很蹩脚,我很抱歉。

Consider a website build using python and django. In many cases it uses 3rd party modules beside standard python library - such as pytz, South, timezones or debug toolbar.

What is standard or just convenient way to deploy such application to production hosting with all the prerequisites (timezones, etc) installed automatically?

I'm new to python, and sorry if this question is lame.

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

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

发布评论

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

评论(3

江湖正好 2024-09-23 07:31:53

至少有两种选择。 Django 联合创始人之一 Jacob Kaplan-Moss 写过关于使用 buildoutdjangorecipe。还有多功能的 fabric。您应该能够单独使用其中任何一个或与一些自定义脚本结合使用来解决您的问题。

There are at least two options available. Jacob Kaplan-Moss, one of the co founders of Django has written about packaging an application using buildout and djangorecipe. There is also the versatile fabric. You should be able to tackle your problem using either of these alone or in combination with some custom scripts.

雄赳赳气昂昂 2024-09-23 07:31:53

Fabric is definitely a nice way to accomplish this. There is a fairly extensive blog write up on the process at http://www.caktusgroup.com/blog/2010/04/22/basic-django-deployment-with-virtualenv-fabric-pip-and-rsync/.

The key to fabric is "fabfile.py" - there's an example of one that does a deployment at http://bitbucket.org/copelco/caktus-deployment/src/tip/example-django-project/caktus_website/fabfile.py.

The variation of this that I've used to deploy to a Linode instance is http://gist.github.com/556508

拥抱我好吗 2024-09-23 07:31:53

您可以使用 Fabric (http://fabfile.org/) 等部署解决方案,也可以尝试打包整个事情都变成了一个带有依赖项的Python Egg,当你easy_install它时,它会自动安装。请参阅 http://mxm-mad-science .blogspot.com/2008/02/python-eggs-simple-introduction.html 简单介绍了 python Eggs。

You can either use a deployment solution like fabric (http://fabfile.org/) or you can try to package the entire thing up into a python egg with dependencies that will be automatically installed when you easy_install it. See http://mxm-mad-science.blogspot.com/2008/02/python-eggs-simple-introduction.html for a simple introduction to python eggs.

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