Here is the error:
TypeError: __init__() takes exactly 1 argument (3 given) ERROR:root:Exception in callback <tornado.stack_context._StackContextWrapper object at 0x1017d4470> Traceback (most recent call last): File "/Library/Python/2.7/site-packages/tornado-2.4.1-py2.7.egg/tornado/ioloop.py", line 421, in _run_callback callback() File "/Library/Python/2.7/site-packages/tornado-2.4.1-py2.7.egg/tornado/iostream.py", line 311, in wrapper callback(*args) File "/Library/Python/2.7/site-packages/tornado-2.4.1-py2.7.egg/tornado/httpserver.py", line 268, in _on_headers self.request_callback(self._request) File "/Library/Python/2.7/site-packages/tornado-2.4.1-py2.7.egg/tornado/web.py", line 1395, in __call__ handler = spec.handler_class(self, request, **spec.kwargs) TypeError: __init__() takes exactly 1 argument (3 given)
And here is the code:
class IndexHandler(tornado.web.RequestHandler): def __init__(self): self.title = "Welcome!" def get(self): self.render("index.html", title=self.title)
I simplified the code to the above and I'm confused why this is causing this error. I have to do something wrong, but I have no idea that (3 arguments passed ??? ... mmmm?)
Note: the title variable is just <title>{{ title }}</title> in my index.html template.
I am running Python 2.7.3 in the 32-bit version to work with Mysqldb-Python. As you can see, my version of Tornado is 2.4.1. I also work on OSX Lion (if that matters ...) Perhaps a compatibility issue that ultimately causes this error?
Any help is appreciated when debugging. Thanks.
source share