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
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
Sorry, it took me a while to test that out, but it works great! Thank you,
that's exactly what I needed.
I had to wrap my head around how cache works, but this tread help me
out: https://groups.google.com/forum/#!topic/web2py/w1b5ZvO9JqY
--
Resources:
- http://web2py.com
-
I do not know cassandra well enough. You can use
connection = cache.ram('cassandra', lambda: establish_connection(), None)
so the connection is cached in ram. The DAL has pooling and works better
but nobody wrote a cassandra adapter. Perhaps you could try that.
On Wednesday, 29 March 2017
Hi,
I'm using external Python driver (e.g.,
https://github.com/datastax/python-driver) to use Cassandra in web2py, but
the issue I have is that I need to get a new Cassandra connection on every
query (and this is quite slow, 2-3 sec).
*So I wonder if there is a way to preserve a connection?*
The DAL does not have a Cassandra adapter, so you'll have to use an
external Python driver (e.g., https://github.com/datastax/python-driver).
Anthony
On Monday, January 27, 2014 1:55:03 AM UTC-5, Manoj bhupathiraju wrote:
Any idea of how to link cassandra and web2py. Please reply ASAP
The DAL does not have a Cassandra adapter, so you'll have to use an
external Python driver (e.g., https://github.com/datastax/python-driver).
Or code your own adapter (and perhaps share it)
7 matches
Mail list logo