Since QLever UI was built upon Python/Django further information and details on the setup and configuration process (especially in production environments) can be found in the Django documentation.
We provide a docker image as well as instructions for a manual setup.
We assume docker to be installed on your machine for the following instructions.
- To get started clone the QLever UI repo on your machine:
git clone https://github.com/ad-freiburg/qlever-ui.git qlever-ui cd qlever-ui
- Optionally adjust settings
- Finally, build the Docker image by running:
You have now created a Docker Image that contains everything you need to run QLever UI.
docker build -t qleverui .
NOTE: You can skip this step if you already have a database file.
-
To set up the database, first, run a bash shell inside the QLever UI container as follows.
docker run -it --rm \ -v "$(pwd)/db:/app/db" \ --entrypoint "bash" qleverui
Where
$(pwd)/db
is the path where QLever UI should store its database. If you want to use a different path, make sure to change this part in all subsequentdocker
commands. -
Create the empty database file with the following command.
python manage.py migrate
-
For configuring your QLever UI backend you will need an administrative user for the QLever UI administration panel. You can create a "superuser" by entering
python manage.py createsuperuser
and following the instructions in your terminal.
You can now exit the container as QLever UI is finally ready to run.
To run a QLever UI container use the following command:
docker run -it -p 7000:7000 \
-v "$(pwd)/db:/app/db" \
--name qleverui \
qleverui
Note: If you already have a QLever UI database file qleverui.sqlite3
you want to use, make sure it is located in the specified path or provide the correct path to it.
If you want the container to run in the background and restart automatically replace -it
with -d --restart=unless-stopped
You should now be able to connect to QLever UI via http://localhost:7000. Continue with configuring QLever UI.
When not using docker there are some additional steps to do. QLever UI is built upon a Python 3 / Django 5 backend so you will need to have Python 3 installed in order to run QLever UI. It's strongly recommended to use virtual environments to manage the project's dependencies when not using the docker build. In order to manage the dependencies, we use pip.
-
If "pip" is installed on your system / in your virtual environment you can simply use
pip install -r requirements.txt
inside the project folder to automatically install all dependencies. Otherwise, you can find the list of dependencies in the
requirements.txt
file to install them manually. -
Optionally adjust settings
-
The QLever UI backend needs a database connection - by default SQLite is used and no further configuration is required. Simply run:
python manage.py makemigrations --merge && python manage.py migrate
inside the project folder in order to do so. You will only need to do this once. If you prefer you can also overwrite the database settings to use some other database management system in your
.env
. -
For configuring your QLever UI backend you will need an administrative user for the QLever UI administration panel. You can create an admin account by simply running the following command in your project folder:
./manage.py createsuperuser
and following the instructions in your terminal.
You can either start a development server by simply running
./manage.py runserver localhost:7000
or prepare a productive environment as described in the Django documentation.
You can start the development instance at any time with this single command and access your instance by opening http://localhost:7000. Feel free to change the port or hostname if needed. Read more about configuration in the next chapter.
- You can adjust some basic settings in
.env
or using environment variables. All the available options are listed in.env
. - You can generate a secure
SECRET_KEY
and write it into.env
with:python3 -c 'from django.core.management.utils import get_random_secret_key; print(f"SECRET_KEY={get_random_secret_key()}")' >> .env
- You can overwrite all settings in
qlever/settings_local.py
. Just set the setting to the value you want it to have. See the Django documentation for the available settings.
The precedence (the top item has the highest precedence) of the Django settings is:
qlever/settings_local.py
- Environment variables
.env
- Deprecated:
settings_secret.py
(only applied for non-default values) - Default values in
qlever/settings.py