Skip to content

Commit

Permalink
Merge pull request #98 from ral-facilities/80_debug_mode_is_not_applied
Browse files Browse the repository at this point in the history
Debug mode is not applied
  • Loading branch information
keiranjprice101 authored Oct 18, 2019
2 parents 9e624a1 + 0386de2 commit 0a269e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ The required python libraries:
## Setup and running the API
The database connection needs to be set up first. This is set in config.json, an example config file called `config.json.example` is provided.


To run the API from the command line, the enviroment variable `FLASK_APP` should be set to `src/main.py`. Once this is
Ideally the API would be run with:
`python -m src.main`
However it can be run with the flask run command as shown below:


**Warning: the host, port and debug config options will not be respected when the API is run this way**

To use `flask run`, the enviroment variable `FLASK_APP` should be set to `src/main.py`. Once this is
set the API can be run with `flask run` while inside the root directory of the project. The `flask run` command gets installed with flask.

Examples shown:
Expand Down
4 changes: 2 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,6 @@
"/instruments/<int:instrument_id>/facilitycycles/<int:cycle_id>/investigations/count")

if __name__ == "__main__":
app.run(host=config.get_host(), port=config.get_port())
app.run(debug=config.is_debug_mode())
app.run(host=config.get_host(), port=config.get_port(), debug=config.is_debug_mode())


0 comments on commit 0a269e3

Please sign in to comment.