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
- Before building the Docker Image, move the
settings_secret_template.py
file tosettings_secret.py
and adjust it to fit your needs.mv qlever/settings_secret_template.py qlever/settings_secret.py
- 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 8000:8000 \
-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:8000. 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 3 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. -
Next, you will need to adjust your individual settings in
qlever/settings_secret_template.py
and rename it toqlever/settings_secret.py
. You may want to edit the file to fit your needs.mv qlever/settings_secret_template.py qlever/settings_secret.py
-
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
settings_secret.py
. -
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:8000
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:8000. Feel free to change the port or hostname if needed. Read more about configuration in the next chapter.