aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/app.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2010-07-17 13:32:57 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2010-07-17 13:32:57 -0500
commit73e0dbcca32ed18c0ab63cfde8b34cd112b9e528 (patch)
tree80d24f9a1284cb39e44d3dc6424b146c2cd21909 /mediagoblin/app.py
parent31a8ff428869614db3cae06ab24dbdb1e3d98064 (diff)
downloadmediagoblin-73e0dbcca32ed18c0ab63cfde8b34cd112b9e528.tar.lz
mediagoblin-73e0dbcca32ed18c0ab63cfde8b34cd112b9e528.tar.xz
mediagoblin-73e0dbcca32ed18c0ab63cfde8b34cd112b9e528.zip
Basic but useless connection to the database
Diffstat (limited to 'mediagoblin/app.py')
-rw-r--r--mediagoblin/app.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mediagoblin/app.py b/mediagoblin/app.py
index 41ab7f20..4095acc2 100644
--- a/mediagoblin/app.py
+++ b/mediagoblin/app.py
@@ -3,6 +3,7 @@ import urllib
from webob import Request, exc
import routes
+import pymongo
from mediagoblin import routing, util
@@ -23,8 +24,9 @@ class MediagoblinApp(object):
"""
Really basic wsgi app using routes and WebOb.
"""
- def __init__(self, user_template_path=None):
+ def __init__(self, database, user_template_path=None):
self.template_env = util.get_jinja_env(user_template_path)
+ self.db = database
def __call__(self, environ, start_response):
request = Request(environ)
@@ -60,5 +62,9 @@ class MediagoblinApp(object):
def paste_app_factory(global_config, **kw):
+ connection = pymongo.Connection()
+ db = kw.get('db_name', 'mediagoblin')
+
return MediagoblinApp(
+ db,
user_template_path=kw.get('local_templates'))