summaryrefslogtreecommitdiff
path: root/docs/narr/MyProject/myproject/__init__.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2010-11-04 01:32:02 -0400
committerChris McDonough <chrism@plope.com>2010-11-04 01:32:02 -0400
commitbf380180c2c5e56131690a56a613c9a229ba7cf8 (patch)
tree3d7cb2d48b1741cb51a6714cd8ca631c99870dba /docs/narr/MyProject/myproject/__init__.py
parent7a3465215705a114abac44ae1002904019b0a467 (diff)
downloadpyramid-bf380180c2c5e56131690a56a613c9a229ba7cf8.tar.gz
pyramid-bf380180c2c5e56131690a56a613c9a229ba7cf8.tar.bz2
pyramid-bf380180c2c5e56131690a56a613c9a229ba7cf8.zip
fix project documentation to account for starter paster template changes
Diffstat (limited to 'docs/narr/MyProject/myproject/__init__.py')
-rw-r--r--docs/narr/MyProject/myproject/__init__.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/docs/narr/MyProject/myproject/__init__.py b/docs/narr/MyProject/myproject/__init__.py
index cbdfd3ac6..2dbaf0a88 100644
--- a/docs/narr/MyProject/myproject/__init__.py
+++ b/docs/narr/MyProject/myproject/__init__.py
@@ -1,2 +1,18 @@
-# A package
+from pyramid.configuration import Configurator
+from myproject.models import get_root
+
+def app(global_config, **settings):
+ """ This function returns a WSGI application.
+
+ It is usually called by the PasteDeploy framework during
+ ``paster serve``.
+ """
+ config = Configurator(root_factory=get_root, settings=settings)
+ config.begin()
+ config.add_view('myproject.views.my_view',
+ context='myproject.models.MyModel',
+ renderer='myproject:templates/mytemplate.pt')
+ config.add_static_view('static', 'myproject:templates/static')
+ config.end()
+ return config.make_wsgi_app()