getnikola / coil

A user-friendly CMS frontend for Nikola.
https://coil.readthedocs.org/
MIT License
22 stars 10 forks source link

Using Coil in limited mode #43

Closed mr-tcan closed 8 years ago

mr-tcan commented 8 years ago

I was trying to test Coil in limited mode using the instructions I found on official documentation.

After the setup, I run coil devserver and hit the login page, but when I put the login information 'admin/admin', I got this error:

I'am running Ubuntu 15.10 x64 with Python 3.4.3.

Thanks for your time.

builtins.TypeError

TypeError: hashpw() argument 1 must be str, not bytes
Traceback (most recent call last)

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/flask/app.py", line 1836, in __call__

    return self.wsgi_app(environ, start_response)

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/flask/app.py", line 1820, in wsgi_app

    response = self.make_response(self.handle_exception(e))

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/flask/app.py", line 1403, in handle_exception

    reraise(exc_type, exc_value, tb)

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise

    raise value

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/flask/app.py", line 1817, in wsgi_app

    response = self.full_dispatch_request()

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/flask/app.py", line 1477, in full_dispatch_request

    rv = self.handle_user_exception(e)

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/flask/app.py", line 1381, in handle_user_exception

    reraise(exc_type, exc_value, tb)

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise

    raise value

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/flask/app.py", line 1475, in full_dispatch_request

    rv = self.dispatch_request()

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/flask/app.py", line 1461, in dispatch_request

    return self.view_functions[rule.endpoint](**req.view_args)

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/coil/web.py", line 580, in login

    request.form['password'])

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/coil/web.py", line 233, in check_password

    return bcrypt_sha256.verify(password, pwdhash)

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/passlib/utils/handlers.py", line 571, in verify

    return consteq(self._calc_checksum(secret), chk)

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/passlib/handlers/bcrypt.py", line 597, in _calc_checksum

    return super(bcrypt_sha256, self)._calc_checksum(key)

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/passlib/handlers/bcrypt.py", line 406, in _calc_checksum

    self.get_backend()

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/passlib/utils/handlers.py", line 1365, in get_backend

    cls.set_backend()

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/passlib/handlers/bcrypt.py", line 603, in set_backend

    return bcrypt.set_backend(*args, **kwds)

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/passlib/handlers/bcrypt.py", line 286, in set_backend

    cls._scan_backend(backend)

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/passlib/handlers/bcrypt.py", line 301, in _scan_backend

    "$2a$05$/OK.fbVrR/bpIqNJ5ianF.CE5elHaaO4EbggVDjb8P19RukzXSM3e"):

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/passlib/utils/handlers.py", line 571, in verify

    return consteq(self._calc_checksum(secret), chk)

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/passlib/handlers/bcrypt.py", line 451, in _calc_checksum

    return self._calc_checksum_backend(secret, config)

    File "/home/thhg/workspace/coil/venv/lib/python3.4/site-packages/passlib/handlers/bcrypt.py", line 490, in _calc_checksum_pybcrypt

    hash = _bcrypt.hashpw(secret, config)

    TypeError: hashpw() argument 1 must be str, not bytes
Kwpolska commented 8 years ago

Cannot reproduce (with Python 3.5, but should not matter). What bcrypt module is installed? Do you get any pybcrypt warnings?

mr-tcan commented 8 years ago

I think I found the problem. I didn't have bcrypt installed.

Once I installed manually, coil worked fine.

Now I'm running coil with flask-bcrypt=0.7.1 instead of flask-bcrypt=0.6.2, because the newer version relies on bcrypt, not on python-bcrypt, so, there is no need to install bcrypt manually.