Skip to content

@thapar /single_file_app.py
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.