Skip to Content
Flask Framework Cookbook - Second Edition
book

Flask Framework Cookbook - Second Edition

by Shalabh Aggarwal
July 2019
Beginner to intermediate
302 pages
9h 38m
English
Packt Publishing
Content preview from Flask Framework Cookbook - Second Edition

How to do it...

There are a few conventions that need to be followed in order to deploy using Beanstalk. It assumes that there will be a file called application.py, which contains the application object (in our case, the app object). Beanstalk treats this file as the WSGI file, and this is used for deployment. Let's get started.

In the Deploying with Apache recipe, we had a file named app.wgsi where we referred to our app object as application because apache/mod_wsgi needed it to be so. The same thing happens here because Amazon, by default, deploys using Apache behind the scenes.
  1. The contents of this application.py file will be just a few lines long, as shown here:
from my_app import app as application import sys, logging logging.basicConfig(stream ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Writing a Web Application with Flask

Writing a Web Application with Flask

Doug Farrell
Mastering Flask

Mastering Flask

Jack Stouffer

Publisher Resources

ISBN: 9781789951295Supplemental Content