public
Created

  • Download Gist
single_file_app.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
from pyramid.response import Response
from pyramid.config import Configurator
from pyramid.view import view_config
from wsgiref.simple_server import make_server
#from pyramid.session import UnencryptedCookieSessionFactoryConfig
#from pyramid.authentication import AuthTktAuthenticationPolicy
#from pyramid.authorization import ACLAuthorizationPolicy
 
 
@view_config(route_name='home')
def my_view(request):
return Response('hello')
 
if __name__ == '__main__':
# authn_policy = AuthTktAuthenticationPolicy(secret='s0secret')
# authz_policy = ACLAuthorizationPolicy()
# session_factory = UnencryptedCookieSessionFactoryConfig('itsaseekreet')
config = Configurator(
settings={},
# session_factory=session_factory,
# authentication_policy=authn_policy,
# authorization_policy=authz_policy
)
config.add_route('home', '/')
config.scan('.')
app = config.make_wsgi_app()
server = make_server('0.0.0.0', 8080, app)
server.serve_forever()

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.