简体   繁体   中英

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). 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. There is flask, celery, diesel, gunicorn, nginx, django and a lot more other packages and or framework.

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 . Nginx is a web server as in Apache. gunicorn is a WSGI compliant HTTP server that can be used to glue Django (the web framework) to Nginx (the Web Server). 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). 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. Don't even worry about getting to know gunicorn, nginx or celery until you need to deploy a production application. 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. 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. So in other words, don't over-think it--just dive in!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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