Created
March 22, 2013 01:12
-
-
Save thapar/5218205 to your computer and use it in GitHub Desktop.
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.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