Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

10. Scaling your Webapp: Getting real > Controlling your App Engine webapp

Controlling your App Engine webapp

Like your other webapps, it makes sense to arrange your webapp controller code within a specific folder structure. Here’s one suggestion:

image with no caption
image with no caption

As you’ve seen, any CGI can run on GAE, but to get the most out of Google’s technology, you need to code to the WSGI standard. Here’s some boilerplate code that every WSGI-compatible GAE webapp starts with:

image with no caption

App Engine Code Magnets

Let’s put everything together. Your model code is already in your hfwwgDB.py file. All you need to do is move that file into your webapp’s top-level folder. Copy your templates folder in there, too. Your webapp’s controller code, in a file called hfwwg.py, also needs to exist in your top-level folder. The only problem is that some of the code’s all over the floor. Rearrange the magnets to fix things.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial