Last active
November 4, 2019 06:41
-
-
Save moriyoshi/e6d09243690c4666a5f7 to your computer and use it in GitHub Desktop.
run it with `gunicorn --paste app.ini`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[app:main] | |
use = call:server:paster_main | |
[server:main] | |
use = egg:gunicorn#main | |
host = 0.0.0.0 | |
port = 8000 | |
workers = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<p>${message}</p> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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