Python Forum

Full Version: tornado psycopg2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Alright when I run python3 main.py I get this :
2020-02-20 12:50:29,223 Database.py:22 _error_: _error_ connecting to database
2020-02-20 12:50:29,224 Database.py:27 _error_: Intialization needs connection fir st
2020-02-20 12:50:29,228 main.py:69 INFO: Application listening on port 8000

when I enter my servers ip:8000

I get this _error_:
Error:
2020-02-20 12:50:55,098 web.py:1788 _error_: Uncaught exception GET /login (myip) HTTPServerRequest(protocol='http', host='serversip:8000', method='GET', uri='/login', version='HTTP/1.1', remote_ip='myip') Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 1697, in _execute result = method(*self.path_args, **self.path_kwargs) File "/var/www/biriba/html/Source/View/LoginHandler.py", line 17, in get self.render(data) File "/var/www/biriba/html/Source/View/BaseHandler.py", line 43, in render for key, valueType in self.contract.iteritems(): AttributeError: 'dict' object has no attribute 'iteritems' 2020-02-20 12:50:55,104 web.py:2246 _error_: 500 GET /login (myip) 6.96ms
here is the repo :
https://github.com/nikoszn/Biriba-master

I think it doesnt connect to postgres,is that the issue if so how do I fix it? I hope someone can help me
It seems that your code is written for Python2.x (dict.iteritems()), but you are trying to use it Python3.6. Try to rename .iteritems() to .items() in BaseHandler. However, there are probably other errors in the code.