Created
February 3, 2012 19:42
-
-
Save benspaulding/1731980 to your computer and use it in GitHub Desktop.
itty + wsgiref error?
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
itty starting up (using wsgiref)... | |
Listening on http://localhost:8080... | |
Use Ctrl-C to quit. | |
Traceback (most recent call last): | |
File "/usr/local/Cellar/python/2.7.2/lib/python2.7/wsgiref/handlers.py", line 85, in run | |
self.result = application(self.environ, self.start_response) | |
File "/Users/benspaulding/dev/virtualenv/sample/lib/python2.7/site-packages/itty.py", line 286, in handle_request | |
return response.send(start_response) | |
File "/Users/benspaulding/dev/virtualenv/sample/lib/python2.7/site-packages/itty.py", line 253, in send | |
start_response(status, final_headers) | |
File "/usr/local/Cellar/python/2.7.2/lib/python2.7/wsgiref/handlers.py", line 169, in start_response | |
raise AssertionError("Headers already set!") | |
AssertionError: Headers already set! | |
localhost - - [03/Feb/2012 13:38:55] "GET / HTTP/1.1" 500 59 |
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
# -*- coding: utf-8 -*- | |
""" | |
TODO: DOC -- add module documentation here. | |
""" | |
from itty import * | |
from jinja2 import Environment, PackageLoader | |
# Setup templates. http://jinja.pocoo.org/docs/api/#basics | |
env = Environment(loader=PackageLoader('sample', 'templates')) | |
@get('/') | |
def index(request): | |
""" Homepage. """ | |
template = env.get_template('index.html') | |
output = template.render() | |
response = Response(output) | |
return response.send(request._start_response) | |
# Ready ... GO! | |
run_itty() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment