summaryrefslogtreecommitdiff
path: root/docs/narr/MyProject/myproject/__init__.py
blob: 2dbaf0a88a44320ac6854d577c419521aa4dbee0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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()