From mypyflask at gmail.com Sat Sep 1 18:05:58 2018 From: mypyflask at gmail.com (Ann Pye) Date: Sat, 1 Sep 2018 18:05:58 -0400 Subject: [Flask] Serving flask applications on AWS Message-ID: Hi I have an app in Flask which is pretty lightweight (right now) and want to know if using Gunicorn + nginx is standard for deployment on AWS EC2. As of now I don't have (any/much) load-balancing or scalability requirements but may have in future. I was looking for on/off-line resources that would help make decisions around how to choose web server architectures for this kind of setup (Python based applications- using nginx/AWS) and how to modify when scaling ? ( I have checked out the following- flask.pocoo.org, Miguel Grinberg's book/blog (uses Heroku) https://www.reddit.com/r/Python/comments/6ediwp/what_is_the_most_ideal_way_of_deploying_flask/ , https://realpython.com/kickstarting-flask-on-ubuntu-setup-and-deployment/ and a few blogs/q&as on stackoverflow etc. ) Thanks, AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsdtux at gmail.com Sat Sep 1 18:12:43 2018 From: bsdtux at gmail.com (Josh Stephens) Date: Sat, 1 Sep 2018 15:12:43 -0700 Subject: [Flask] Serving flask applications on AWS In-Reply-To: References: Message-ID: Hi Ann, ? That is a great question. It is my belief that most developers tend to deploy their flask applications utilizing Gunicorn and Nginx. Most of the time this will be facilitated by starting the app using supervisord and then having nginx proxy to your application. The documentation that I tend to reference often is https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-18-04. This has been a generic write so that it can be done in any location like AWS / DigitalOcean and I believe this is what Heroku does as well. Best Regards, Josh Stephens On September 1, 2018 at 5:06:13 PM, Ann Pye (mypyflask at gmail.com) wrote: > Hi > > I have an app in Flask which is pretty lightweight (right now) and want to > know if using Gunicorn + nginx is standard for deployment on AWS EC2. As of > now I don't have (any/much) load-balancing or scalability requirements but > may have in future. I was looking for on/off-line resources that would help > make decisions around how to choose web server architectures for this kind > of setup (Python based applications- using nginx/AWS) and how to modify > when scaling ? > ( I have checked out the following- > flask.pocoo.org, Miguel Grinberg's book/blog (uses Heroku) > https://www.reddit.com/r/Python/comments/6ediwp/what_is_the_most_ideal_way_of_deploying_flask/ > , https://realpython.com/kickstarting-flask-on-ubuntu-setup-and-deployment/ > and a few blogs/q&as on stackoverflow etc. ) > > Thanks, > AB > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask > From mypyflask at gmail.com Sat Sep 1 21:36:27 2018 From: mypyflask at gmail.com (Ann Pye) Date: Sat, 1 Sep 2018 21:36:27 -0400 Subject: [Flask] Serving flask applications on AWS In-Reply-To: References: Message-ID: Thank you so much Josh. I did checkout the same website as well (although for a diff ubuntu version) and found this description most comprehensive than all. I was also specifically looking for resources that go into the "why" of what servers etc to choose etc in addition to the "how" to do. I want to understand why I would choose nginx and/or gunicorn over other combinations and "why" I may/may not need to change them in future. Any info (books?/blogs?) serving that? Best, AB On Sat, Sep 1, 2018 at 6:12 PM Josh Stephens wrote: > Hi Ann, > > That is a great question. It is my belief that most developers tend > to deploy their flask applications utilizing Gunicorn and Nginx. Most > of the time this will be facilitated by starting the app using > supervisord and then having nginx proxy to your application. The > documentation that I tend to reference often is > > https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-18-04 > . > This has been a generic write so that it can be done in any location > like AWS / DigitalOcean and I believe this is what Heroku does as > well. > > Best Regards, > Josh Stephens > > > On September 1, 2018 at 5:06:13 PM, Ann Pye (mypyflask at gmail.com) wrote: > > Hi > > > > I have an app in Flask which is pretty lightweight (right now) and want > to > > know if using Gunicorn + nginx is standard for deployment on AWS EC2. As > of > > now I don't have (any/much) load-balancing or scalability requirements > but > > may have in future. I was looking for on/off-line resources that would > help > > make decisions around how to choose web server architectures for this > kind > > of setup (Python based applications- using nginx/AWS) and how to modify > > when scaling ? > > ( I have checked out the following- > > flask.pocoo.org, Miguel Grinberg's book/blog (uses Heroku) > > > https://www.reddit.com/r/Python/comments/6ediwp/what_is_the_most_ideal_way_of_deploying_flask/ > > , > https://realpython.com/kickstarting-flask-on-ubuntu-setup-and-deployment/ > > and a few blogs/q&as on stackoverflow etc. ) > > > > Thanks, > > AB > > _______________________________________________ > > Flask mailing list > > Flask at python.org > > https://mail.python.org/mailman/listinfo/flask > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From seandavi at gmail.com Sun Sep 2 08:42:53 2018 From: seandavi at gmail.com (Sean Davis) Date: Sun, 2 Sep 2018 08:42:53 -0400 Subject: [Flask] Serving flask applications on AWS In-Reply-To: References: Message-ID: I recently deployed a Flask app using Zappa: https://github.com/Miserlou/Zappa The process was surprisingly simple and I have been quite happy with the results. Sean On Sat, Sep 1, 2018 at 6:06 PM Ann Pye wrote: > Hi > > I have an app in Flask which is pretty lightweight (right now) and want to > know if using Gunicorn + nginx is standard for deployment on AWS EC2. As of > now I don't have (any/much) load-balancing or scalability requirements but > may have in future. I was looking for on/off-line resources that would help > make decisions around how to choose web server architectures for this kind > of setup (Python based applications- using nginx/AWS) and how to modify > when scaling ? > ( I have checked out the following- > flask.pocoo.org, Miguel Grinberg's book/blog (uses Heroku) > https://www.reddit.com/r/Python/comments/6ediwp/what_is_the_most_ideal_way_of_deploying_flask/ > , > https://realpython.com/kickstarting-flask-on-ubuntu-setup-and-deployment/ > and a few blogs/q&as on stackoverflow etc. ) > > Thanks, > AB > > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask > -- Sean Davis, MD, PhD Center for Cancer Research National Cancer Institute National Institutes of Health Bethesda, MD 20892 https://seandavi.github.io/ https://twitter.com/seandavis12 -------------- next part -------------- An HTML attachment was scrubbed... URL: From michaelmossey at gmail.com Wed Sep 26 03:14:22 2018 From: michaelmossey at gmail.com (Michael Mossey) Date: Wed, 26 Sep 2018 00:14:22 -0700 Subject: [Flask] Need pointers to general introduction to web frameworks Message-ID: A few days ago a friend asked me to help build a Slack app in Python, something that posts a message with buttons and a dialog. I found this example: https://github.com/slackapi/python-message-menu-example (this example uses Flask as well as the Python slack API) I'm a programmer, but don't have much web experience. I'm discovering that there is a whole world I don't really understand, and it's kind of hard to find an introduction to it, because everything seems to assume that I already understand the basics. If these are basic questions, don't feel a need to answer it completely, but a few pointers as to what's going on and then where to look for more would be appreciated. First, I don't understand what role Flask plays in this example. Is Flask a web server? Is it some kind of server that browsers contact and interact with, even if not as full-featured as Apache? If not, what else is it? And what is Flask doing in this Slack example? I read in the Flask documentation that it's a "micro-framework," but I don't know what a framework is. So I went here: https://wiki.python.org/moin/WebFrameworks and this is not much help, because it assumes I know what a "web application" is, or "server side technology", or "AJAX." I also don't know what "full stack" means. Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.prebble at gmail.com Wed Sep 26 04:17:21 2018 From: thomas.prebble at gmail.com (Thomas Prebble) Date: Wed, 26 Sep 2018 17:17:21 +0900 Subject: [Flask] Need pointers to general introduction to web frameworks In-Reply-To: References: Message-ID: Hello Michael, I'm not all too familiar with the internals of Slack but the Readme suggests that Slack makes a request to /slack/message_options to populate a menu and then makes a request to /slack/message_actions with the user selection (which is analogous to a callback). This is a fairly common pattern for extending third party applications. That's a very brief explanation but hopefully understandable. The term "web server" has different meanings to different people. I would suggest reading https://www.quora.com/What-is-the-difference-between-web-server-and-web-application and https://stackoverflow.com/questions/936197/what-is-the-difference-between-application-server-and-web-server which should give you a decent breakdown of the two. Frameworks are a big topic but you might try viewing them as libraries. The key difference to "fully fledged" frameworks versus micro-frameworks comes down to the functionality they provide out of the box. For example Django (another Python web application framework) has it's own ORM (for working with databases), templating language and support for i18n. Flask (a micro-framework) at it's core doesn't maintain any of this and relies on third party plugins to support such use cases and more. This gives the developer more freedom to choose which components he might need to incorporate into a given project without including anything else. Hopefully that helps? Thomas On Wed, 26 Sep 2018 at 16:14, Michael Mossey wrote: > A few days ago a friend asked me to help build a Slack app in Python, > something that posts a message with buttons and a dialog. I found this > example: > > https://github.com/slackapi/python-message-menu-example > > (this example uses Flask as well as the Python slack API) > > I'm a programmer, but don't have much web experience. I'm discovering that > there is a whole world I don't really understand, and it's kind of hard to > find an introduction to it, because everything seems to assume that I > already understand the basics. > > If these are basic questions, don't feel a need to answer it completely, > but a few pointers as to what's going on and then where to look for more > would be appreciated. > > First, I don't understand what role Flask plays in this example. Is Flask > a web server? Is it some kind of server that browsers contact and interact > with, even if not as full-featured as Apache? If not, what else is it? And > what is Flask doing in this Slack example? > > I read in the Flask documentation that it's a "micro-framework," but I > don't know what a framework is. So I went here: > > https://wiki.python.org/moin/WebFrameworks > > and this is not much help, because it assumes I know what a "web > application" is, or "server side technology", or "AJAX." I also don't know > what "full stack" means. > > Mike > > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask > -------------- next part -------------- An HTML attachment was scrubbed... URL: From coreybrett at gmail.com Wed Sep 26 08:19:34 2018 From: coreybrett at gmail.com (Corey Boyle) Date: Wed, 26 Sep 2018 08:19:34 -0400 Subject: [Flask] Need pointers to general introduction to web frameworks In-Reply-To: References: Message-ID: Flask Web Development: Developing Web Applications with Python by Miguel Grinberg Link: http://a.co/d/iI8WfXZ This book is an excellent way to get started with Flask. Flask is just a bunch of glue code that saves you the pain of building a router yourself. Flask has a builtin web server, but it's only intended for development purposes. You will need to host your production code on-top of Apache or GUnicorn or any number of other web servers. On Wed, Sep 26, 2018 at 4:18 AM Thomas Prebble wrote: > > Hello Michael, > > I'm not all too familiar with the internals of Slack but the Readme suggests that Slack makes a request to /slack/message_options to populate a menu and then makes a request to /slack/message_actions with the user selection (which is analogous to a callback). This is a fairly common pattern for extending third party applications. That's a very brief explanation but hopefully understandable. > > The term "web server" has different meanings to different people. I would suggest reading https://www.quora.com/What-is-the-difference-between-web-server-and-web-application and https://stackoverflow.com/questions/936197/what-is-the-difference-between-application-server-and-web-server which should give you a decent breakdown of the two. > > Frameworks are a big topic but you might try viewing them as libraries. The key difference to "fully fledged" frameworks versus micro-frameworks comes down to the functionality they provide out of the box. For example Django (another Python web application framework) has it's own ORM (for working with databases), templating language and support for i18n. Flask (a micro-framework) at it's core doesn't maintain any of this and relies on third party plugins to support such use cases and more. This gives the developer more freedom to choose which components he might need to incorporate into a given project without including anything else. > > Hopefully that helps? > > Thomas > > On Wed, 26 Sep 2018 at 16:14, Michael Mossey wrote: >> >> A few days ago a friend asked me to help build a Slack app in Python, something that posts a message with buttons and a dialog. I found this example: >> >> https://github.com/slackapi/python-message-menu-example >> >> (this example uses Flask as well as the Python slack API) >> >> I'm a programmer, but don't have much web experience. I'm discovering that there is a whole world I don't really understand, and it's kind of hard to find an introduction to it, because everything seems to assume that I already understand the basics. >> >> If these are basic questions, don't feel a need to answer it completely, but a few pointers as to what's going on and then where to look for more would be appreciated. >> >> First, I don't understand what role Flask plays in this example. Is Flask a web server? Is it some kind of server that browsers contact and interact with, even if not as full-featured as Apache? If not, what else is it? And what is Flask doing in this Slack example? >> >> I read in the Flask documentation that it's a "micro-framework," but I don't know what a framework is. So I went here: >> >> https://wiki.python.org/moin/WebFrameworks >> >> and this is not much help, because it assumes I know what a "web application" is, or "server side technology", or "AJAX." I also don't know what "full stack" means. >> >> Mike >> >> _______________________________________________ >> Flask mailing list >> Flask at python.org >> https://mail.python.org/mailman/listinfo/flask > > _______________________________________________ > Flask mailing list > Flask at python.org > https://mail.python.org/mailman/listinfo/flask From michaelmossey at gmail.com Wed Sep 26 13:27:55 2018 From: michaelmossey at gmail.com (Michael Mossey) Date: Wed, 26 Sep 2018 10:27:55 -0700 Subject: [Flask] Need pointers to general introduction to web frameworks In-Reply-To: References: Message-ID: thanks, all. I know this isn't purely a Flask question, but I think it's closely related or will help me understand Flask. If this is completely off-topic, please ignore. What I'm not clear on... how do I get this demo app (Flask + Slack) to work? Am I supposed to host a Slack server or an Apache server or something like that on my local machine, or does this work with slack.com, or something else? Is there something about using Flask that I supposed to understand? Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From ernstki at mail.uc.edu Thu Sep 27 17:51:42 2018 From: ernstki at mail.uc.edu (Ernst, Kevin (ernstki)) Date: Thu, 27 Sep 2018 21:51:42 +0000 Subject: [Flask] Need pointers to general introduction to web, frameworks In-Reply-To: References: Message-ID: <5c1ee6c0-9688-8aa1-ab89-f44301974c92@mail.uc.edu> Hi Mike, You're probably already clear on this first part (the definition of a web server), but just to lead up to the explanation of why you need Flask for the demo app: a web server in this sense is a thing that runs one or more web applications, presents the "user interface" to those application as web pages to users' web browsers, and responds to users' interactions with those web pages. If you're familiar with HTML at all, you might know that you can double-click a .html file on your PC and that will open up in a web browser. That's called a "static" web page. No web server was necessarily required to deliver that to your browser, the web browser just opened the file off your hard drive. However, serving "static" web pages over a public URL on the Internet is one thing that web servers (in the Apache sense) can do. One other thing that a web server can do is to receive messages which represent users' interactions with the web pages it's responsible for serving, then communicate those interactions with *other* programs running on that computer (or another one), programs which are interested in performing actions based on those users' interactions. Like sending a password reset email, or fulfilling an order from an online checkout system. This is where you start hearing terms like "dynamic web pages," Ajax, and that sort of thing. You can add a