You have
db = cluster.connect('mykeyspace')
which means that for you db is not a DAL() object but a Cassandra
connection. You the pass it to
auth = Auth(db)
but here Auth(...) expects a DAL() object.
On Friday, 22 September 2017 20:18:28 UTC-5, 黄祥 wrote:
>
> tryin to use cassandra with web2py using cassandra-driver but return an
> error:
> e.g.
> *cassandra side*
> pip install cassandra-driver
> systemctl restart cassandra
> cqlsh
>
> cqlsh> show version
> [cqlsh 5.0.1 | Cassandra 3.11.0 | CQL spec 3.4.4 | Native protocol v4]
> cqlsh> CREATE KEYSPACE mykeyspace WITH replication = {'class':
> 'SimpleStrategy', 'replication_factor': 1};
>
> *web2py side version 2.15.4*
> create new web2py app
> *models/db.py*
> if not request.env.web2py_runtime_gae:
> from cassandra.cluster import Cluster
> cluster = Cluster(['127.0.0.1'] )
> db = cluster.connect('mykeyspace')
>
> *error:*
> Traceback (most recent call last):
> File "/home/site/web2py/gluon/restricted.py", line 219, in restricted
> exec(ccode, environment)
> File "/home/site/web2py/applications/a/models/db.py", line 73, in
> <module>
> auth.define_tables(username=False, signature=False)
> File "/home/site/web2py/gluon/tools.py", line 2210, in define_tables
> migrate = db._migrate
> AttributeError: 'NoneType' object has no attribute '_migrate'
>
> any wayout to face this?
>
> thanks and best regards,
> stifan
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.