From bf380180c2c5e56131690a56a613c9a229ba7cf8 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 4 Nov 2010 01:32:02 -0400 Subject: fix project documentation to account for starter paster template changes --- docs/narr/MyProject/myproject/__init__.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'docs/narr/MyProject/myproject/__init__.py') 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() -- cgit v1.2.3