diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fa2f41ce..b5565e47 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -77,6 +77,24 @@ poetry run python poetry run datadoc ``` +## Config for local development + +We use a python package called `python-dotenv` for configuration management. This gives two possibilities for sourcing configuration: + +1. Environment variables. +1. A file called `.env` by convention. + +To set up for local development run this command from the root of the repo. + +1. Create a file `src/datadoc/.env` +1. Place the following lines in the file: +``` +DATADOC_DASH_DEVELOPMENT_MODE=True +DATADOC_LOG_LEVEL=debug +``` + +To see all configuration options, see `src/datadoc/config.py` + ## How to test the project Run the full test suite: diff --git a/src/datadoc/app.py b/src/datadoc/app.py index ccf836b9..7e898895 100644 --- a/src/datadoc/app.py +++ b/src/datadoc/app.py @@ -118,7 +118,9 @@ def main(dataset_path: str | None = None) -> None: port=port, ) else: - app.run(debug=config.get_dash_development_mode(), port=port) + if dev_mode := config.get_dash_development_mode(): + logger.warning("Starting in Development Mode. NOT SUITABLE FOR PRODUCTION.") + app.run(debug=dev_mode, port=port) if __name__ == "__main__":