A newer version of this documentation is available.

View Latest

Quick start

Follow the steps tio quickly start working with the sample application.
  1. Ensure you have Flask installed. You can either install it via your distribution or use pip install Flask.

  2. Download Couchbase Server and install it. Make sure to install the beer-sample data set when you run the wizard because this tutorial application works with it.

  3. Clone the repository and move into the directory:

    $ git clone git://github.com/couchbaselabs/beersample-python
    Cloning into 'beersample-python'
    $ cd beersample-python
  4. Some views need to be set up. You can set up the views manually via the Web UI, or invoke the design_setup.py script located in the beersample-python directory.

    In the beer design document, create a view called by_name :

    function (doc, meta) {
        if (doc.type && doc.type == "beer") {
            emit(doc.name, null);
        }
    }

    Create a design document called brewery and add a view called by_name

    function (doc, meta) {
        if (doc.type && doc.type == "brewery") {
            emit(doc.name, null);
        }
    }
  5. Invoke the beer.py script:

    $ python beer.py
    * Running on http://0.0.0.0:5000/
    * Restarting with reloader
  6. Navigate to localhost:5000 and enjoy the application!