简体   繁体   English

Python Web项目的剖析:开发,打包,部署

[英]The anatomy of a Python web project: development, packaging, deployment

I'm new to Python (from Java+Ant) and was wondering if someone could detail how to best use Fabric+Pip+Virtualenv to set up a Python web application package skeleton. 我是Python的新手(来自Java + Ant),想知道是否有人可以详细说明如何最好地使用Fabric + Pip + Virtualenv来设置Python Web应用程序包框架。

The end goal is to be able to do any of the following with a single command: 最终目标是能够使用单个命令执行以下任一操作:

  • Set up a development environment on a fresh dev box (installing all deps) 在新的开发箱上设置开发环境(安装所有部门)
  • Run all tests 运行所有测试
  • Package and deploy to staging 打包并部署到暂存
  • Deploy staging to production 将阶段部署到生产
  • Other typical dev flow tasks: migrate schema, etc. 其他典型的开发流程任务:迁移架构等。

I'm using Debian+git+Tornado, but I'd like to keep this OS/SCM/framework agnostic if possible. 我正在使用Debian + git + Tornado,但如果可能的话,我想使此OS / SCM / framework不可知。

I've done some searching but I'm yet to find something definitive that covers this from top to bottom. 我已经进行了一些搜索,但是还没有找到确定的从上到下覆盖所有内容的方法。 I would find this very helpful, I imagine there are a few other ex-Java/PHP/whatever guys out there who would too. 我会觉得这很有帮助,我想还有其他一些前Java / PHP /其他人也可以。

Thanks! 谢谢!

Check out my answer here . 在这里查看我的答案。 It doesn't address all of your questions (mostly the first bullet-point, in fact), but hopefully it gets you started. 它并不能解决您的所有问题(实际上,多数是第一个要点),但是希望它可以帮助您入门。

Keeping it framework agnostic will probably be quite hard. 保持框架不可知性可能很困难。

But maybe you'll find the following paster templates (for Django projects though) quite useful too. 但是也许您会发现以下粘贴模板(尽管适用于Django项目)也非常有用。 http://morethanseven.net/2010/03/28/More-django-project-templates.html http://morethanseven.net/2010/03/28/More-django-project-templates.html

Though Paster has quite a learning curve (at least from my point of view), it'll cover your needs for "project skeletons" quite nicely. 尽管Paster具有相当的学习曲线(至少从我的角度来看),但是它将很好地满足您对“项目框架”的需求。 Actually, with Paster templates, you can achieve similar things to what Maven Archetypes do for you. 实际上,使用Paster模板,您可以实现与Maven原型为您所做的相似的事情。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM