# Get a reference to the Application class.
from web.core import Application


# This is our WSGI application instance.
app = Application("Hi.")


# If we're run as the "main script", serve our application over HTTP.
if __name__ == "__main__":
	app.serve('wsgiref')


# Get a reference to the Application class.
from web.core import Application

# Get references to web framework extensions.
from web.ext.annotation import AnnotationExtension
from web.ext.debug import DebugExtension
from web.ext.serialize import SerializationExtension
from web.ext.db import DBExtension

# Get a reference to our database connection adapter.
from web.db.mongo import MongoDBConnection

# Get a reference to our Wiki root object.
from web.app.wiki.root import Wiki


# This is our WSGI application instance.
app = Application(Wiki, extensions=[
		AnnotationExtension(),
		DebugExtension(),
		SerializationExtension(),
		DBExtension(MongoDBConnection("mongodb://localhost/test")),
	])


# If we're run as the "main script", serve our application over HTTP.
if __name__ == "__main__":
	app.serve('wsgiref')


Make use of root object and WebCore extensions.
Make use of root object and WebCore extensions.

The Wiki root object is now the root of the sample application and the
following extensions have been configured:

- [`AnnotationExtension`](https://github.com/marrow/WebCore/blob/develop/web/ext/annotation.py)
- [`DebugExtension`](https://github.com/marrow/WebCore/blob/develop/web/ext/debug.py)
- [`SerializationExtension`](https://github.com/marrow/WebCore/blob/develop/web/ext/serialize.py)
- [`DBExtension`](https://github.com/marrow/WebCore/blob/develop/web/ext/db.py)

The default databse has been configured to use the
[`marrow.mongo`](https://github.com/marrow/mongo) WebCore adapter,
connecting to a MongoDB database named `test` on the local machine.
