diff --git a/demos/appengine/README b/demos/appengine/README
deleted file mode 100644
index e4aead6701..0000000000
--- a/demos/appengine/README
+++ /dev/null
@@ -1,48 +0,0 @@
-Running the Tornado AppEngine example
-=====================================
-This example is designed to run in Google AppEngine, so there are a couple
-of steps to get it running. You can download the Google AppEngine Python
-development environment at http://code.google.com/appengine/downloads.html.
-
-1. Link or copy the tornado code directory into this directory:
-
- ln -s ../../tornado tornado
-
- AppEngine doesn't use the Python modules installed on this machine.
- You need to have the 'tornado' module copied or linked for AppEngine
- to find it.
-
-3. Install and run dev_appserver
-
- If you don't already have the App Engine SDK, download it from
- http://code.google.com/appengine/downloads.html
-
- To start the tornado demo, run the dev server on this directory:
-
- dev_appserver.py .
-
-4. Visit http://localhost:8080/ in your browser
-
- If you sign in as an administrator, you will be able to create and
- edit blog posts. If you sign in as anybody else, you will only see
- the existing blog posts.
-
-
-If you want to deploy the blog in production:
-
-1. Register a new appengine application and put its id in app.yaml
-
- First register a new application at http://appengine.google.com/.
- Then edit app.yaml in this directory and change the "application"
- setting from "tornado-appenginge" to your new application id.
-
-2. Deploy to App Engine
-
- If you registered an application id, you can now upload your new
- Tornado blog by running this command:
-
- appcfg update .
-
- After that, visit application_id.appspot.com, where application_id
- is the application you registered.
-
diff --git a/demos/appengine/app.yaml b/demos/appengine/app.yaml
deleted file mode 100644
index 2d00c586dd..0000000000
--- a/demos/appengine/app.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-application: tornado-appengine
-version: 1
-runtime: python
-api_version: 1
-
-handlers:
-- url: /static/
- static_dir: static
-
-- url: /.*
- script: blog.py
diff --git a/demos/appengine/blog.py b/demos/appengine/blog.py
deleted file mode 100644
index 2a8c40a071..0000000000
--- a/demos/appengine/blog.py
+++ /dev/null
@@ -1,169 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009 Facebook
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-import functools
-import markdown
-import os.path
-import re
-import tornado.web
-import tornado.wsgi
-import unicodedata
-import wsgiref.handlers
-
-from google.appengine.api import users
-from google.appengine.ext import db
-
-
-class Entry(db.Model):
- """A single blog entry."""
- author = db.UserProperty()
- title = db.StringProperty(required=True)
- slug = db.StringProperty(required=True)
- markdown = db.TextProperty(required=True)
- html = db.TextProperty(required=True)
- published = db.DateTimeProperty(auto_now_add=True)
- updated = db.DateTimeProperty(auto_now=True)
-
-
-def administrator(method):
- """Decorate with this method to restrict to site admins."""
- @functools.wraps(method)
- def wrapper(self, *args, **kwargs):
- if not self.current_user:
- if self.request.method == "GET":
- self.redirect(self.get_login_url())
- return
- raise tornado.web.HTTPError(403)
- elif not self.current_user.administrator:
- if self.request.method == "GET":
- self.redirect("/")
- return
- raise tornado.web.HTTPError(403)
- else:
- return method(self, *args, **kwargs)
- return wrapper
-
-
-class BaseHandler(tornado.web.RequestHandler):
- """Implements Google Accounts authentication methods."""
- def get_current_user(self):
- user = users.get_current_user()
- if user: user.administrator = users.is_current_user_admin()
- return user
-
- def get_login_url(self):
- return users.create_login_url(self.request.uri)
-
- def render_string(self, template_name, **kwargs):
- # Let the templates access the users module to generate login URLs
- return tornado.web.RequestHandler.render_string(
- self, template_name, users=users, **kwargs)
-
-
-class HomeHandler(BaseHandler):
- def get(self):
- entries = db.Query(Entry).order('-published').fetch(limit=5)
- if not entries:
- if not self.current_user or self.current_user.administrator:
- self.redirect("/compose")
- return
- self.render("home.html", entries=entries)
-
-
-class EntryHandler(BaseHandler):
- def get(self, slug):
- entry = db.Query(Entry).filter("slug =", slug).get()
- if not entry: raise tornado.web.HTTPError(404)
- self.render("entry.html", entry=entry)
-
-
-class ArchiveHandler(BaseHandler):
- def get(self):
- entries = db.Query(Entry).order('-published')
- self.render("archive.html", entries=entries)
-
-
-class FeedHandler(BaseHandler):
- def get(self):
- entries = db.Query(Entry).order('-published').fetch(limit=10)
- self.set_header("Content-Type", "application/atom+xml")
- self.render("feed.xml", entries=entries)
-
-
-class ComposeHandler(BaseHandler):
- @administrator
- def get(self):
- key = self.get_argument("key", None)
- entry = Entry.get(key) if key else None
- self.render("compose.html", entry=entry)
-
- @administrator
- def post(self):
- key = self.get_argument("key", None)
- if key:
- entry = Entry.get(key)
- entry.title = self.get_argument("title")
- entry.markdown = self.get_argument("markdown")
- entry.html = markdown.markdown(self.get_argument("markdown"))
- else:
- title = self.get_argument("title")
- slug = unicodedata.normalize("NFKD", title).encode(
- "ascii", "ignore")
- slug = re.sub(r"[^\w]+", " ", slug)
- slug = "-".join(slug.lower().strip().split())
- if not slug: slug = "entry"
- while True:
- existing = db.Query(Entry).filter("slug =", slug).get()
- if not existing or str(existing.key()) == key:
- break
- slug += "-2"
- entry = Entry(
- author=self.current_user,
- title=title,
- slug=slug,
- markdown=self.get_argument("markdown"),
- html=markdown.markdown(self.get_argument("markdown")),
- )
- entry.put()
- self.redirect("/entry/" + entry.slug)
-
-
-class EntryModule(tornado.web.UIModule):
- def render(self, entry):
- return self.render_string("modules/entry.html", entry=entry)
-
-
-settings = {
- "blog_title": "Tornado Blog",
- "template_path": os.path.join(os.path.dirname(__file__), "templates"),
- "ui_modules": {"Entry": EntryModule},
- "xsrf_cookies": True,
-}
-application = tornado.wsgi.WSGIApplication([
- (r"/", HomeHandler),
- (r"/archive", ArchiveHandler),
- (r"/feed", FeedHandler),
- (r"/entry/([^/]+)", EntryHandler),
- (r"/compose", ComposeHandler),
-], **settings)
-
-
-def main():
- wsgiref.handlers.CGIHandler().run(application)
-
-
-if __name__ == "__main__":
- main()
diff --git a/demos/appengine/markdown.py b/demos/appengine/markdown.py
deleted file mode 100644
index f60632d9eb..0000000000
--- a/demos/appengine/markdown.py
+++ /dev/null
@@ -1,1877 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2007-2008 ActiveState Corp.
-# License: MIT (http://www.opensource.org/licenses/mit-license.php)
-
-r"""A fast and complete Python implementation of Markdown.
-
-[from http://daringfireball.net/projects/markdown/]
-> Markdown is a text-to-HTML filter; it translates an easy-to-read /
-> easy-to-write structured text format into HTML. Markdown's text
-> format is most similar to that of plain text email, and supports
-> features such as headers, *emphasis*, code blocks, blockquotes, and
-> links.
->
-> Markdown's syntax is designed not as a generic markup language, but
-> specifically to serve as a front-end to (X)HTML. You can use span-level
-> HTML tags anywhere in a Markdown document, and you can use block level
-> HTML tags (like
and
as well).
-
-Module usage:
-
- >>> import markdown2
- >>> markdown2.markdown("*boo!*") # or use `html = markdown_path(PATH)`
- u'