diff --git a/README.md b/README.md index f22a8bec054841259c59d4952b89e683c9ff806f..83409808ba17e237e03dd0a25e1a887f8248ffaf 100644 --- a/README.md +++ b/README.md @@ -1 +1,55 @@ -# Django application server +# DALIA's backend Django application server + +## Development setup + +### Requirements + +* Python 3 (Which version? ... Works in 3.11) +* pip +* Docker (if using Testcontainers in tests) + +### Setup + +Clone this repo: +```shell +git clone https://git.rwth-aachen.de/dalia/backend/django.git +``` + +Create and activate a virtual environment: +```shell +cd django +python3 -m venv .env +source .env/bin/activate +``` + +Install dependencies: +```shell +pip install -r requirements-dev.txt +``` + +### Running tests using Testcontainers + +[Testcontainers](https://testcontainers.com/) is used to provide [DALIA's Fuseki triplestore](https://git.rwth-aachen.de/dalia/backend/fuseki) as dependency during tests via the `triplestore` pytest fixture. + +To run tests: +```shell +pytest +``` + +### Running tests using a custom triplestore URL + +The `triplestore` pytest fixture can also be configured to use a custom URL to [DALIA's Fuseki triplestore](https://git.rwth-aachen.de/dalia/backend/fuseki). This can be achieved by using the `TRIPLESTORE_URL` environment variable. + +To run tests: +```shell +TRIPLESTORE_URL="http://127.0.0.1:3030/" pytest +``` + +### Starting Django in "development mode" + +Note: You may need to alter `DALIA_TRIPLESTORE_BASE_URL` in [project/settings.py](project/settings.py) to the correct address of [DALIA's Fuseki triplestore](https://git.rwth-aachen.de/dalia/backend/fuseki). + +To start Django: +```shell +./manage.py runserver 0.0.0.0:8000 +```