Skip to content
Snippets Groups Projects
Select Git revision
  • dev
  • main default protected
  • 10-implement-suggested-content-on-material-page
  • allauth
4 results

django

  • Clone with SSH
  • Clone with HTTPS
  • DALIA's backend Django application server

    Configuration

    Environment variables are to be used for configuration. The most convenient way to set those variables is to copy .env_template to .env and to edit it.

    Using the Docker images

    Reusable Docker images are provided via GitLab's container registry.

    Maintained image tags

    • latest: built from the main branch; used in DALIA's production system
    • dev: built from the dev branch; used in DALIA's staging system

    Deployment example

    docker-compose.yml contains a simple example deployment of this Django application server and the DALIA's Fuseki triplestore.

    To start the deployment:

    docker-compose up

    To stop and remove the deployed application:

    docker-compose down

    Development setup

    Requirements

    • Python 3 (Which version? ... Works in 3.11)
    • pip
    • Docker (if using Testcontainers in tests)

    Setup

    Clone this repo:

    git clone https://git.rwth-aachen.de/dalia/backend/django.git

    Create and activate a virtual environment:

    cd django
    python3 -m venv .venv
    source .venv/bin/activate

    Install dependencies:

    pip install -r requirements-dev.txt

    Running tests using Testcontainers

    Testcontainers is used to provide DALIA's Fuseki triplestore as dependency during tests via the triplestore pytest fixture.

    To run tests:

    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. This can be achieved by using the TRIPLESTORE_URL environment variable.

    To run tests:

    TRIPLESTORE_URL="http://127.0.0.1:3030/" pytest

    Starting Django in "development mode"

    To start Django:

    ./manage.py runserver 0.0.0.0:8000