Skip to content

Installation Instructions (in English)

Joe Blankenship edited this page May 21, 2017 · 2 revisions

Installation

Virtual Environment

For convenience it is recommended to use a virtualenv.

  1. Install Virtualenv: (sudo apt-get install python-virtualenv in Debian / Ubuntu).
  2. Once installed, create a Virtualenv: virtualenv libreqda. As of now, LibreQDA use python 2.7. You may need to use virtualenv --python=python2.7 libreqda
  3. Activate the Virtualenv: cd libreqda and then source bin/activate.

Get the code

  1. To install git (if not installed): sudo apt-get install git
  2. Then download the source code for LibreQDA: git clone https://github.com/libreqda/libreQDA.git.

Outbuildings

Before you can start you need to install some dependencies.

  1. Install build-essential: sudo apt-get install build-essential.
  2. Install MySQL: sudo apt-get install mysql-server libmysqlclient-dev libevent-dev libxml2-dev libxslt1-dev.
  3. The requirements.txt file contains a list of dependencies to install (make sure your virtualenv is activated). Install all of them automatically with the cd libreQDA command pip install -r requirements.txt.
  4. If you run into errors during the automatic install, cat requirements.txt and pip install each python library without the version number.

Configure and run

  1. Create a database for LibreQDA. The database encoding must be UTF-8 to avoid problems uploading documents. mysql -u root -p to activate mysql as user 'root' and request user password `CREATE DATABASE libreqda CHARACTER SET utf8 COLLATE utf8_general_ci;
  2. Copy the local_settings.py.template file next to the code to local_settings.py (in libreQDA/libreqda).
  3. Open the new file, local_settings.py and edit as needed (change 'USER' and 'PASSWORD' to the mysql username and password).
  4. Create the database with django: python manage.py syncdb. During the process, you will be asked for a username and password, which will be the access data to your installation of libreQDA
  5. Run with: python manage.py runserver

To update

  1. Backup your data! Data is deleted from the database when a reset is performed. It is possible to use Dumpdata and Loaddata to easily export and import data.
  2. To update LibreQDA you simply need to pull the repository with git pull and then update the database with python manage.py reset libreqda.
  3. It is also necessary to update dependencies with: pip install -r requirements.txt.

How to add support for other file types

Adding support for other types of files is relatively simple. There are two files to modify: * Validators.py: Contains code to allow or not to upload a particular file type. * Text_extraction.py: Contains the code to extract the text of each of the different allowed file types.

  1. Open the validators.py file.
  2. In the SUPPORTED_FILETYPES tuple add a string with the file type. For example, for Postscript files, add '.ps' to the tuple.
  3. Open the `tex_extraction.py file.
  4. Add a new function with the file extension as the name. For example, to process Postscript files, add a function called ps.
  5. The new function will receive a single parameter, this being the path to the new uploaded file. The function should open the file and extract the text, to finally return an object of type string with the contents of file. This value will be saved in the database.

ALL

Currently to determine the file type, LibreQDA is based on the extension. File type identification should be done using python-magic.