# ${project_camelcase}

## Branches

### master


Setting up development Environment on Linux
----------------------------------

### Install Project (edit mode)

#### Working copy
    
    $ cd /path/to/workspace
    $ git clone git@github.com:Carrene/${project_snakecase}.git
    $ cd ${project_snakecase}
    $ pip install -e .
 
### Setup Database

#### Configuration

```yaml

db:
  url: postgresql://postgres:postgres@localhost/${project_snakecase}_dev
  test_url: postgresql://postgres:postgres@localhost/${project_snakecase}_test
  administrative_url: postgresql://postgres:postgres@localhost/postgres

messaging:
  default_messenger: restfulpy.messaging.SmtpProvider

smtp:
  host: <example.com>
  port: 587
  username: <smtp-user>
  password: <smtp-password>
  local_hostname: carrene.com
   
```

#### Remove old abd create a new database **TAKE CARE ABOUT USING THAT**

    $ ${project_snakecase} db create --drop --mockup

And or

    $ ${project_snakecase} db create --drop --basedata 

#### Drop old database: **TAKE CARE ABOUT USING THAT**

    $ ${project_snakecase} [-c path/to/config.yml] db --drop

#### Create database

    $ ${project_snakecase} [-c path/to/config.yml] db --create

Or, you can add `--drop` to drop the previously created database: **TAKE CARE ABOUT USING THAT**

    $ ${project_snakecase} [-c path/to/config.yml] db create --drop


### Running tests

```bash
pip install -r requirements-dev.txt
pytests
```

### Running server

#### Single threaded 

```bash
${project_snakecase} [-c path/to/config.yml] serve
```

#### WSGI

wsgi.py

```python
from ${project_snakecase} import ${project_snakecase}
${project_snakecase}.configure(files=...)
app = ${project_snakecase}
```

```bash
gunicorn wsgi:app
```

### How to start

Checkout `${project_snakecase}/controllers/foo.py`, 
`${project_snakecase}/models/foo.py` and `${project_snakecase}/tests/test_foo.py` to
learn how to create an entity.

