From clint.olsen at gmail.com Sat Feb 23 18:23:59 2019 From: clint.olsen at gmail.com (Clint Olsen) Date: Sat, 23 Feb 2019 15:23:59 -0800 Subject: [Flask] The big picture: nginx + gunicorn + flask Message-ID: Hi: It's taken me awhile, but I actually have created a small webapp that actually does something useful, and Flask made it's part pretty straightforward. However, now that I've created a single webapp, the question arises: How should an app coexist with others to potentially make up an entire website? I found some helpful docs over at: http://exploreflask.com/en/latest/organizing.html This is about the level of complexity I have now (obviously very basic): app.pystatic/templates/ Someone who had developed with Django got me started with a nginx + gunicorn + flask template to get things rolling. However, in the end I just have gunicorn calling my webapp. This doesn't easily scale if I have to have nginx rules -> gunicorn instances for every app. I realize that these things are a bit outside the scope of Flask. I appreciate the detail at the app level, but now I need to step back and see how it all comes together. Any pointers would be appreciated. Thanks, -Clint -------------- next part -------------- An HTML attachment was scrubbed... URL: From ub at artfacts.net Tue Feb 26 07:40:40 2019 From: ub at artfacts.net (ulrich) Date: Tue, 26 Feb 2019 13:40:40 +0100 Subject: [Flask] The big picture: nginx + gunicorn + flask In-Reply-To: References: Message-ID: <33c69289-4d29-463c-58c3-bd9396aa19db@artfacts.net> hey clint, On 2/24/19 12:23 AM, Clint Olsen wrote: > Hi: > > It's taken me awhile, but I actually have created a small webapp that > actually does something useful, and Flask made it's part pretty > straightforward. > > However, now that I've created a single webapp, the question arises: > How should an app coexist with others to potentially make up an entire > website? > > I found some helpful docs over at: > > http://exploreflask.com/en/latest/organizing.html > > This is about the level of complexity I have now (obviously very basic): > app.py > static/ > templates/ > Someone who had developed with Django got me started with a nginx + > gunicorn + flask template to get things rolling. > However, in the end I just have gunicorn calling my webapp. i guess in the end you'll always have your web-app wrapped by an app-server of some sort. > This doesn't easily scale if I have to have nginx rules -> gunicorn > instances for every app. depends how you imagine to scale, but nginx rules can be automated too. with ansible for example. when you say "every app" here, i realize, you might be talking about composing/organizing a somewhat monolithic APP. have you looked into blueprints? that might be just what you're looking for. http://flask.pocoo.org/docs/1.0/blueprints/ if you really do mean a multitude of small apps, uswgi for example has "emperor" mode for multi-app deployment. possibly gunicorn has a similar feature. https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html > I realize that these things are a bit outside the scope of Flask. I > appreciate the detail at the app level, but now I need to step back > and see how it all comes together. Any pointers would be appreciated. hope that helps. cheers, ub > > Thanks, > > -Clint > > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask -------------- next part -------------- An HTML attachment was scrubbed... URL: From clint.olsen at gmail.com Tue Feb 26 18:54:20 2019 From: clint.olsen at gmail.com (Clint Olsen) Date: Tue, 26 Feb 2019 15:54:20 -0800 Subject: [Flask] The big picture: nginx + gunicorn + flask In-Reply-To: <33c69289-4d29-463c-58c3-bd9396aa19db@artfacts.net> References: <33c69289-4d29-463c-58c3-bd9396aa19db@artfacts.net> Message-ID: Hi Ulrich: I had only briefly been introduced to blueprints when I was reading Richard Picard's Explore Flask site. I will definitely check this out. The official docs additionally mention "app-dispatch" at http://flask.pocoo.org/docs/1.0/patterns/appdispatch/#app-dispatch which may also be applicable. Thank you, -Clint On Tue, Feb 26, 2019 at 4:41 AM ulrich wrote: > hey clint, > > > On 2/24/19 12:23 AM, Clint Olsen wrote: > > Hi: > > It's taken me awhile, but I actually have created a small webapp that > actually does something useful, and Flask made it's part pretty > straightforward. > > However, now that I've created a single webapp, the question arises: How > should an app coexist with others to potentially make up an entire website? > > I found some helpful docs over at: > > http://exploreflask.com/en/latest/organizing.html > > This is about the level of complexity I have now (obviously very basic): > > app.pystatic/templates/ > > Someone who had developed with Django got me started with a nginx + > gunicorn + flask template to get things rolling. > > > However, in the end I just have gunicorn calling my webapp. > > i guess in the end you'll always have your web-app wrapped by an > app-server of some sort. > > > This doesn't easily scale if I have to have nginx rules -> gunicorn > instances for every app. > > depends how you imagine to scale, but nginx rules can be automated too. > with ansible for example. > > when you say "every app" here, i realize, you might be talking about > composing/organizing a somewhat monolithic APP. have you looked into > blueprints? that might be just what you're looking for. > > http://flask.pocoo.org/docs/1.0/blueprints/ > > if you really do mean a multitude of small apps, uswgi for example has > "emperor" mode for multi-app deployment. possibly gunicorn has a similar > feature. > > https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html > > I realize that these things are a bit outside the scope of Flask. I > appreciate the detail at the app level, but now I need to step back and see > how it all comes together. Any pointers would be appreciated. > > hope that helps. > > cheers, > > ub > > > Thanks, > > -Clint > > _______________________________________________ > Flask mailing listFlask at python.orghttps://mail.python.org/mailman/listinfo/flask > > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask > -------------- next part -------------- An HTML attachment was scrubbed... URL: