简体   繁体   English

nginx烧瓶gunicorn python…从哪里开始?

[英]nginx flask gunicorn python … where to start?

I'm a heavy windows users(been programming and administering servers in windows environment) who is beginning to learn unix, and wanting to learn how things work on linux(using debian). 我是一个沉重的Windows用户(开始在Windows环境中编程和管理服务器),他们开始学习unix,并希望了解Linux(使用debian)在Linux上如何工作。 I'm starting to get a hold of how stuff works at the OS level, but I'm a bit overwhelmed when looking at developing application in this new environment using python. 我开始掌握东西在OS级别上的工作方式,但是在使用python在这种新环境中开发应用程序时,我有点不知所措。 There is flask, celery, diesel, gunicorn, nginx, django and a lot more other packages and or framework. 有烧瓶,芹菜,柴油,gunicorn,nginx,django和许多其他包装或框架。

Does anyone know a good way to understand all this component? 有谁知道理解所有这些组件的好方法? a good book or web link perhaps? 好书或网页链接? My goal is to understand and know when to use certain packages and/or framework during development process. 我的目标是了解并知道在开发过程中何时使用某些软件包和/或框架。

thanks in advance for any tips you can provide. 在此先感谢您提供的任何提示。

You mention a number of related (and interchangeable) technologies. 您提到了许多相关(和可互换)技术。

For instance Django and Flask are web frameworks . 例如Django和Flask是Web框架 Nginx is a web server as in Apache. Nginx是Apache中的Web服务器 gunicorn is a WSGI compliant HTTP server that can be used to glue Django (the web framework) to Nginx (the Web Server). gunicorn是WSGI兼容的HTTP服务器 ,可用于将Django(Web框架) 粘合到Nginx(Web服务器)。 Basically: 基本上:

Web Framework <-> Glue <-> Web Server

Examples: 例子:

Django <-> fcgi <-> Apache
Flask <-> uWSGI <-> Nginx

The best way to start would be to achieve the above with a popular (highly supported and well-documented) solution. 最好的开始方法是使用流行的(高度支持和有据可查的)解决方案来实现上述目标。 And for that I would recommend deploying Django (personal preference). 为此,我建议您部署Django (个人喜好)。 Doing this should give you an understanding of how the building blocks are inter-connected. 这样做应该使您了解构建模块是如何相互连接的。

Start by developing a basic hello_world web application with flask (there's one implemented in 7 lines of code on the home page), then mess with it. 首先用烧瓶开发一个基本的hello_world Web应用程序(在首页上用7行代码实现了一个应用程序),然后将其弄乱了。 Don't even worry about getting to know gunicorn, nginx or celery until you need to deploy a production application. 甚至在您需要部署生产应用程序之前,也不必担心了解Gunicorn,nginx或芹菜。 Once you do, read their docs and google around for blog posts by people who have written about their experiences setting up those tools and maintaining them, and everything will gradually start to make sense. 完成后,请阅读他们的文档和Google周围的博客文章,这些人已经撰写了有关设置和维护这些工具的经验的文章,然后一切都会逐渐变得有意义。 Also, when you decide to deploy your app, say with webfaction or another hosting company, be aware that they'll provide all kinds of support documentation and may even handle nginx and other aspects of server config for you. 另外,当您决定与webfaction或其他托管公司一起部署应用程序时,请注意,它们将提供各种支持文档,甚至可能为您处理nginx和服务器配置的其他方面。 So in other words, don't over-think it--just dive in! 因此,换句话说,不要想太多了-只需潜入即可!

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

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