EN ET

Installation

Installation for Development

If you want to develop TEXTA Toolkit, want more control over how you run it, or seriously dislike Docker, it is also possible to install Toolkit using Anaconda (or Miniconda as shown in following examples).

Install Miniconda

First one needs to download and install Miniconda to manage Python environments. Miniconda is chosen over Anaconda because it’s smaller in size, but Toolkit works well with both.

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
sh Miniconda3-latest-Linux-x86_64.sh

Also, let’s permanently put Conda binaries to PATH variable:

echo 'export PATH=/path/to/miniconda3/bin:$PATH' >> ~/.bashrc

Clone the Repository

Now, let’s clone the repository and move to texta-rest direcory:

git clone https://git.texta.ee/texta/texta-rest
cd texta-rest

Build the Environment

Now that environment.yaml file from the texta-rest repository is present, let’s use it to build the environment. After the environment is built, let’s activate it:

conda env create -f environment-nogpu.yaml
conda activate texta-rest

Note

If you want Toolkit to use GPU, use environment-gpu.yaml instead.

Migrate & Run Toolkit

After the environment has been created and activated, let’s prepare the database:

python migrate.py

Running the migrate.py script will prepare Django migrations and execute them. It is necessary to run the script every time the source code changes because Toolkit’s data model might have changed as well. It is also required to run the script before using Toolkit for the first time to create both superuser account and database used to store the data model.

Note

Default admin password is defined in the enviroment variable TEXTA_ADMIN_PASSWORD=1234. You can change this to a more suitable password. Without the environment variable the default password is generated automatically and can be obtained from the container log.

Users can overwrite the username by running python migrate.py -u {{username}} instead. In cases where the passwords needs to be overwritten, running python migrate.py -o will overwrite the password with whatever value is in the environment variable TEXTA_ADMIN_PASSWORD.

Finally let’s run the development server:

python manage.py runserver

And in another terminal (with same conda environment and in the same folder) run the Celery worker responsible for asynchronous tasks:

celery -A toolkit.taskman worker -l info

Browsable API

TODO

API Reference

Reference for Toolkit API is available when running the Toolkit: