/finding_dory

A Stevedore/Pecan based Python API reference project for bootstrapping new OpenStack compatible projects

Primary LanguagePythonApache License 2.0Apache-2.0

Finding Dory

A reference project for Python APIs based on OpenStack. In particular, this project uses:

  • oslo.config
  • pecan
  • stevedore

Getting Started

  1. From your home folder, create the ~/.dory folder and clone this repository:

    $ cd ~
    $ mkdir .dory
    $ git clone https://github.com/rackerlabs/finding_dory.git
    
  2. Copy the configuration files to the directory ~/.dory:

    $ cp finding_dory/etc/dory.conf ~/.dory/dory.conf
    $ cp finding_dory/etc/logging.conf ~/.dory/logging.conf
    
  3. For logging, find the [DEFAULT] section in ~/.dory/dory.conf and modify as desired:

    log_file = server.log
    
  4. Install general requirements:

    $ pip install -r requirements/requirements.txt
    
  5. Run the following so you can see the results of any changes you make to the code without having to reinstall the package each time:

    $ pip install -e .
    
  6. Start the web server:

    $ dory-server
    
  7. Test everything is working by requesting the root URL with a sample project ID:

    $ curl -i -H "X-Project-Id: 123" http://0.0.0.0:8888/
    

    You should get an HTTP 200 along with some headers that will look similar to this:

    HTTP/1.0 200 OK
    Date: Tue, 15 Jul 2014 12:44:16 GMT
    Server: WSGIServer/0.1 Python/2.7.6
    Content-Length: 16
    Content-Type: application/json; charset=UTF-8
    
    {"status": "up"}