Coder Social home page Coder Social logo

python-flask-cassandra's Introduction

flask-cassandra

Python Flask Cassandra Simple Shop CRUD

This is a collection of simple and illustrative Cassandra Shop application. The purpose of this collection is to help new Cassandra users better understand Cassandra and to present illustrative use cases.

Getting started

If you don't have access to a Cassandra cluster, you can get started by installing with HomeBrew for Mac.

Getting started

If you already have access to a Cassandra cluster, you should be able to start running this example application right away. All you have to do is set an environment variable on your client indicating where your cluster is located:

   $ export BACKEND_STORAGE_IP='mycluster_ip'

However, if you don't have access to a Cassandra cluster, you can get started by installing Ferry. Ferry is an open-source tool that helps developers provision virtual clusters on a local machine. Ferry supports Cassandra (and other "big data" tools) and doesn't require that you actually know how to configure Cassandra to get started.

Assuming that you are using Ferry, you should run all these commands in a Cassandra client. The first thing to do is install all the prerequisite packages. They can be found in requirements.txt. Here's a simple way to do it from the command line using pip.

   $ pip install -r requirements.txt

Afterwards, you'll want to set up the Cassandra keyspace for our application.

   $ cqlsh -f createtable.cql

After creating the table, you should be able to start the web server by typing:

   $ python app.py runserver

Afterwards, insert some data into Cassandra by typing:

   $ python rest-client.py post

Then, let's see what data got inserted.

   $ python rest-client.py fetch  

Also, let's update what data got inserted.

   $ python rest-client.py update  

Finally, let's delete the data that got inserted.

   $ python rest-client.py delete  

python-flask-cassandra's People

Contributors

hungnguyend avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.