Friday, August 10, 2012

Hosting an existing site on google app engine

I have been getting used to using the google app engine and all of its awesomeness. I searched online for taking an existing site and using the google app engine to host it. I saw this post How to Host your Website on Google for Free but I like my files separated into folders (images, style, newsletters, etc) and not have all of the files in the same directory. So with a little modification to app.yaml I can have my site organized. I plan to use the app engine to host this website I made once my godaddy hosting expires I will switch over. This is my website on appspot.

If you want the project files you can get them here.
Below is the app.yaml.

application: sandwichfp

version: 2
runtime: python
api_version: 1

handlers:

- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

- url: /(.*\.(gif|png|jpg|ico|js|css|pdf))

  static_files: \1
  upload: (.*\.(gif|png|jpg|ico|js|css))

- url: /images(.*\.(gif|png|jpg))
  static_dir: images

- url: /style(.*\.(gif|png|jpg|css)
  static_dir: style

- url: /Newsletters(.*\.(pdf))
  static_dir: Newsletters

- url: /robots.txt
  static_files: robots.txt
  upload: robots.txt

- url: .*
  script: main.py