2.1. Requirements ¶
OnTask has been developed as a Django application. Django is a high-level, python-based web framework that supports a rich set of functionality typically required in applications like OnTask. As many other web applications, OnTask requires a set of additional libraries for its execution, namely:
-
Redis
-
PostgreSQL (version 14.7)
-
Python 3.9
-
Django 4.2
-
Additional Django modules listed in the file
requirements/base.txt
Some of these requirements are handled using pip (Python’s package index application).
2.1.1. Install and Configure Redis ¶
Django requires Redis to execute as a daemon in the same machine to cache information about the sessions. No specific changes are required in the code, simply have the server running in the background.
-
Download and install redis .
Follow the instructions to configure it to be used by Django.
-
Test that it is executing properly in the background (use the
ping
command in the command line interface.
2.1.2. Install and Configure PostgreSQL ¶
-
Download and install postgresql .
-
Create the role
ontask
with the commandcreateuser
. The role should be able to create new databases but not new roles and you should define a password for the user (usecreateuser --interactive -W
). -
Adjust the access configuration in postgresql (in the configuration file
pg_hba.conf
) to allow the newly created user to access databases locally. -
Create a new database with name
ontask
with thecreatedb
command. -
Use the client application
psql
to verify that the user has access the newly created database and can create and delete a new table and run regular queries. Test the connection with the following command:psql -h 127.0.0.1 -U ontask -W ontask
If the client does not connect to the database, review your configuration options.
-
The libraries required by OnTask will install some Python packages compiling the soure and one of them uses the development libraries from PostgreSQL. If you are using a linux distribution, make sure you install the package
postgresql-server-dev-all
.
2.1.3. Install Python 3 ¶
In the following sections we assume that you can open a command line interpreter and you can execute the two python interpreter for version 3.
-
Install python
-
Verify that the interpreter can run and has the right version (3) using the command line interpreter (either
python --version
orpython3 --version
). -
Install pip (the package may be called
python3-pip
for Python 3). This tool will be used to install additional libraries required to execute OnTask. -
Some python libraries will require compiling source code, so make sure the development package for the python version is also installed.