Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Base webpage application for APIS based projects

License

Notifications You must be signed in to change notification settings

acdh-oeaw/apis-webpage-base

Repository files navigation

About

APIS is a Django based webapplication developed by the Austrian Centre for Digital Humanities. We use it to store named entities and relations between them in DH projects.

This is a base project for APIS installations. We use different branches to adapt the base project to the needs of the various projects

Basic Installation

  • Clone this repository and checkout the branch you intend to use

  • Create a virtualenv and activate it:

    virtualenv -p python3 myenv
    source myenv/bin/activate
  • Install the requirements:

    pip install -r requirements.txt
  • Migrate the database:

    python manage.py migrate
  • Add apis-core to urls.py:

    vim ROOT_OF_APIS/apis/urls.py

    uncomment line #8 and save the file

  • Migrate again:

    python manage.py makemigrations browsing
    python manage.py migrate
  • and run the development server:

    python manage.py runserver

Installation for production

For security and performance reasons you dont want to use the development server and/or sqllite.

Use mysql instead of sqllite

  • change to ROOT_OF_APIS/apis/settings

  • copy dev.py to server.py

  • change the DATABASES entry to something along the lines of:

    DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'DATABASE NAME',
        'USER': 'MYSQL USER',
        'PASSWORD': 'password',
        'HOST': 'localhost',   # Or an IP Address that your DB is hosted on
        'PORT': '3306',
        }
    }
  • install the myqlclient library to your virtualenv:

    pip install mysqlclient

Use apache2 instead of the development server

  • for installing and configuring apache2 refer to instructions of your system
  • an example virtualhost definition file:

Additional packages

We have developed (and still are developing) some additional packages to extend the functionalities of APIS.

Highlighter

This package is used to provide annotation functionalities for texts stored in APIS. If installed and

Customization

Basic metadata of the project can be set in apis.settings.base by adapting PROJECT_DEFAULT_MD. The prefered way though is to provide a remote metadata.json.

  • A proper project description should be stored in infos.models.AboutTheProject
  • Info about the project's team members can be stored in infos.models.TeamMember.

References