backend.py py3 compatibility

* do not import exceptions, it's standard
* for py3 long is int
* use str for ip
* create list for views
* change import authlib

Note: I had to install python3-psycopg2 and python3-ipy with apt-get