简体   繁体   English

对于自动python部署,我需要了解/学习什么?

[英]What do I need to know/learn for automated python deployment?

I'm starting a new webapp project in Python to get into the Agile mind-set and I'd like to do things "properly" with regards to deployment. 我正在用Python开始一个新的webapp项目,以进入敏捷思维模式,我想在部署方面做“正确”的事情。 However, I'm finding the whole virtualenv/fabric/zc.buildout/etc stuff a little confusing - I'm used to just FTP'ing PHP files to a server and pointing a webserver at it. 但是,我发现整个virtualenv / fabric / zc.buildout / etc的东西有点令人困惑 - 我习惯于只是将PHP文件FTP到服务器并将Web服务器指向它。

After deployment the server set-up would look something like: 部署后,服务器设置将如下所示:
Nginx --proxy-to--> WSGI Webserver (Spawning) --> WSGI Middleware --> WSGI App (probably MNML or similar)
with the python webserver being managed by supervisord. python webserver由supervisord管理。

What sort of deployment set-up/packages/apps should I be looking into? 我应该研究哪种部署设置/包/应用程序? And is there a specific directory structure I need to stick to with my app to ease deployment? 是否有一个特定的目录结构我需要坚持使用我的应用程序来简化部署?

Your deployment story depends on your app. 您的部署故事取决于您的应用。 Are you using Django? 你在用Django吗? Then the Apache + mod_wsgi deployment docs make for a good starting point. 然后Apache + mod_wsgi部署文档提供了一个很好的起点。 Then you can google around for more detail, such as this 2-part series using pip , virtualenv , git , and fabric . 然后你可以谷歌四处寻找更多细节,比如这个由两部分组成的 系列使用pipvirtualenvgitfabric

Really, fabric , virtualenv , and all those other tools are designed to make it easier to maintain and automate your deployment. 实际上, fabricvirtualenv和所有其他工具旨在使维护和自动化部署更容易。 Initially, the steps from the documentation are probably enough. 最初,文档中的步骤可能就足够了。 After you get a feel for how things work, you can revisit to improve your process. 在了解了工作原理后,您可以重新审视以改进流程。

I've heard good things about Fabric : 我听说过关于Fabric的好东西:

Fabric is a Python library and command-line tool designed to streamline deploying applications or performing system administration tasks via the SSH protocol. Fabric是一个Python库和命令行工具,旨在通过SSH协议简化部署应用程序或执行系统管理任务。 It provides tools for running arbitrary shell commands (either as a normal login user, or via sudo ), uploading and downloading files, and so forth. 它提供了用于运行任意shell命令(作为普通登录用户或通过sudo ),上载和下载文件等的工具。

You already mentioned buildout, and it's all you need. 你已经提到了buildout,这就是你所需要的。 Google for example buildouts for the different parts. 例如,Google针对不同部分进行了扩建。 Takes a while to set it up the first time, but then you can reuse the setup between different projects too. 需要一段时间才能在第一时间进行设置,但是您也可以在不同项目之间重复使用设置。

Let supervisord start everything, not just the python server. 让supervisord开始一切,而不仅仅是python服务器。 Then start supervisord at reboot either fron cron or init.d. 然后在重新启动时从fron cron或init.d启动supervisord。

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

相关问题 什么是PasteDeploy,如果Python中的Eggs被认为已经消失,我是否需要学习它? - What is PasteDeploy and do I need to learn it if Eggs in Python are considered gone? 如果我已经了解Python 3,我该如何学习Python 2? - How do I learn Python 2 if I already know Python 3? 我需要做什么/学习才能使基于文本的Python游戏可供互联网用户访问 - What do I need to do/learn to make my text based Python game accessible to users over the internet Python - 我需要了解旧样式类吗? - Python - do I need to learn about old style classes? 我正在尝试使用pycrypto了解AES,但我不知道自己在做什么错 - I am trying to use pycrypto to learn about AES and I do not know what I am doing wrong 我是 python 的新手,对编码了解不多,但想了解有关如何创建工作代码的更多信息 - I am new to python and do not know much about coding but wanna learn more on how to create working codes 我需要转换数据集并学会自己做 - I need to transfom the dataset and learn to do it by myself 我需要什么软件包才能在Debian上安装scikit-learn - What packages do I need in order to install scikit-learn on Debian Python 方法不起作用我需要做什么? - Python method not working what i need to do? 我怎么知道我以前给sci-kit学习的内容? (朴素贝叶斯分类器。) - How do I know what prior's I'm giving to sci-kit learn? (Naive-bayes classifiers.)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM