<commit_before># digital-register-api

This is the repo for the backend of the digital register service. It is written in Python, with the Flask framework.  

### Digital Register API build status

[![Build Status](http://52.16.47.1/job/digital-register-api-unit-test%20(Master)/badge/icon)](http://52.16.47.1/job/digital-register-api-unit-test%20(Master)/)

### Digital Register Acceptance tests status

[![Build Status](http://52.16.47.1/job/digital-register-frontend-acceptance-tests/badge/icon)](http://52.16.47.1/job/digital-register-frontend-acceptance-tests/)

## Setup

To create a virtual env, run the following from a shell:

```  
    mkvirtualenv -p /usr/bin/python3 digital-register-api
    source environment.sh
    pip install -r requirements.txt
```

## Run the tests

To run the tests for the Digital Register, go to its folder and run `lr-run-tests`. 

## Run the acceptance tests

To run the acceptance tests for the Digital Register, go to the `acceptance-tests` folder inside the `digital-register-frontend` repository and run:
```
   ./run-tests.sh
```

You will need to have a Postgres database running (see `db/lr-start-db` and `db/insert-fake-data` scripts in the [centos-dev-env](https://github.com/LandRegistry/centos-dev-env) project), as well as the digital-register-frontend and digital-register-api applications running on your development VM. 

## Jenkins builds <commit_msg>Add server running instructions to readme<commit_after># digital-register-api

This is the repo for the backend of the digital register service. It is written in Python, with the Flask framework.  

### Digital Register API build status

[![Build Status](http://52.16.47.1/job/digital-register-api-unit-test%20(Master)/badge/icon)](http://52.16.47.1/job/digital-register-api-unit-test%20(Master)/)

### Digital Register Acceptance tests status

[![Build Status](http://52.16.47.1/job/digital-register-frontend-acceptance-tests/badge/icon)](http://172.16.31.10/job/digital-register-frontend-acceptance-tests/)

## Setup

To create a virtual env, run the following from a shell:

```  
    mkvirtualenv -p /usr/bin/python3 digital-register-api
    source environment.sh
    pip install -r requirements.txt
```

## Run the tests

To run the tests for the Digital Register, go to its folder and run `lr-run-tests`. 

## Run the acceptance tests

To run the acceptance tests for the Digital Register, go to the `acceptance-tests` folder inside the `digital-register-frontend` repository and run:
```
   ./run-tests.sh
```

You will need to have a Postgres database running (see `db/lr-start-db` and `db/insert-fake-data` scripts in the [centos-dev-env](https://github.com/LandRegistry/centos-dev-env) project), as well as the digital-register-frontend and digital-register-api applications running on your development VM.
 
## Run the server

### Run in dev mode

To run the server in dev mode, execute the following command:

    ./run_flask_dev.sh

### Run using gunicorn

To run the server using gunicorn, activate your virtual environment
and execute the following commands:

    pip install gunicorn
    gunicorn -p /tmp/gunicorn.pid service.server:app -c gunicorn_settings.py 

## Jenkins builds 
{'fraction_non_alphanumeric': 0.11641697877652935, 'fraction_numerical': 0.02122347066167291, 'mean_word_length': 4.079239302694137, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, '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': '3152706', 'n_tokens_mistral': 1010, 'n_tokens_neox': 942, 'n_words': 321}