Skip to content

Instantly share code, notes, and snippets.

@moriyoshi
Last active November 4, 2019 06:41
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moriyoshi/e6d09243690c4666a5f7 to your computer and use it in GitHub Desktop.
Save moriyoshi/e6d09243690c4666a5f7 to your computer and use it in GitHub Desktop.
run it with `gunicorn --paste app.ini`
[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.mako')
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_mako')
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