<commit_before>#mysqlapi

[![Build Status](https://secure.travis-ci.org/globocom/mysqlapi.png?branch=master)](http://travis-ci.org/globocom/mysqlapi)

This is a service API for MySQL, used for [tsuru](https://github.com/globocom/tsuru).

Installation
------------

First, create an app in tsuru:

    $> tsuru app-create mysql-api python

Add the returned remote to your repository:

    $> git remote add tsuru git@yourremote.git

When the app is in `started` state, push the code:

    $> git push tsuru master

Basic set up
------------

In order to have mysql API ready to receive requests, we need some bootstrap stuff.

First export the django settings variable:

    $> tsuru env-set --app mysql-api DJANGO_SETTINGS_MODULE=mysqlapi.settings

Now gunicorn is able to run with our wsgi.py configuration.
After that, we need to run syncdb:

    $> tsuru run --app mysql-api "python manage.py syncdb --noinput"

Now we're ready to move on.

Choose your configuration mode
------------------------------

There are two modes to configure the API usage behavior:

- `shared`: this configuration forces all applications to share the same mysql installation, in this mode, mysql API
will create a new user and a new database when added/binded by an app.
- `dedicated`: every app using mysql will have a single vm for it's usage, in this mode, mysql API will create a vm,
install everything needed to run mysql based on a predefined AMI and create a user and password.

Everything that is needed by the application to connect with mysql is provided automatically by tsuru, using environment variables,
e.g. when you add/bind your app with mysql service, tsuru will export all environment variables returned by mysql API.

Shared Configuration
--------------------
<commit_msg>readme: use -- instead of quotes<commit_after>#mysqlapi

[![Build Status](https://secure.travis-ci.org/globocom/mysqlapi.png?branch=master)](http://travis-ci.org/globocom/mysqlapi)

This is a service API for MySQL, used for [tsuru](https://github.com/globocom/tsuru).

Installation
------------

First, create an app in tsuru:

    $> tsuru app-create mysql-api python

Add the returned remote to your repository:

    $> git remote add tsuru <EMAIL>

When the app is in `started` state, push the code:

    $> git push tsuru master

Basic set up
------------

In order to have mysql API ready to receive requests, we need some bootstrap stuff.

First export the django settings variable:

    $> tsuru env-set --app mysql-api DJANGO_SETTINGS_MODULE=mysqlapi.settings

Now gunicorn is able to run with our wsgi.py configuration.
After that, we need to run syncdb:

    $> tsuru run --app mysql-api -- python manage.py syncdb --noinput

Now we're ready to move on.

Choose your configuration mode
------------------------------

There are two modes to configure the API usage behavior:

- `shared`: this configuration forces all applications to share the same mysql installation, in this mode, mysql API
will create a new user and a new database when added/binded by an app.
- `dedicated`: every app using mysql will have a single vm for it's usage, in this mode, mysql API will create a vm,
install everything needed to run mysql based on a predefined AMI and create a user and password.

Everything that is needed by the application to connect with mysql is provided automatically by tsuru, using environment variables,
e.g. when you add/bind your app with mysql service, tsuru will export all environment variables returned by mysql API.

Shared Configuration
--------------------

{'fraction_non_alphanumeric': 0.10542592071970762, 'fraction_numerical': 0.0, 'mean_word_length': 3.3179611650485437, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 14, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2026465', 'n_tokens_mistral': 979, 'n_tokens_neox': 952, 'n_words': 472}