Skip to content

Instantly share code, notes, and snippets.

@moriyoshi
Created November 2, 2015 04:26
Show Gist options
  • Save moriyoshi/2eb078e957c3401f8a3d to your computer and use it in GitHub Desktop.
Save moriyoshi/2eb078e957c3401f8a3d to your computer and use it in GitHub Desktop.
[app:main]
use = call:server:paster_main
[server:main]
use = egg:gunicorn#main
host = 0.0.0.0
port = 8000
workers = 1
<html>
<body>
<p>{{ message }}</p>
</body>
</html>
from pyramid.view import view_config
from pyramid.config import Configurator
@view_config(route_name='pyspa.index', renderer='index.jinja2')
def index(context, request):
return {'message':'hello, world!'}
def paster_main(global_config, **local_config):
settings = dict(global_config, **local_config)
config = Configurator(settings=settings)
config.include('pyramid_jinja2')
config.add_route('pyspa.index', '/')
config.scan('.')
return config.make_wsgi_app()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment