Skip to content

acdh-oeaw/mmp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test codecov flake8 Lint

MMP

Mapping Medieval Peoples: Visualizing Semantic Landscapes in Early Medieval Europe

About

a generic djangobaseproject port of https://gitlab.com/acdh-oeaw/imafo/gens, created with following steps:

Install

see the dedicated contributing file or try your luck with the following instructions

  • clone the repo git clone https://github.com/acdh-oeaw/mmp.git
  • [optional]
    • create a virtual env, e.g. virtualenv myenv
    • activate virtual env, e.g. source myenv/bin/activate
  • install needed packages pip install -r requirements.txt (jupyter notebook requirements not incldued)
  • [optional]
    • created your custom settings-file, e.g. pg_local

Start

on a clear database

  • apply migrations python manage.py migrate --settings=djangobaseproject.settings.dev
  • start dev-server python manage.py runserver ---settings=djangobaseproject.settings.dev
  • open http://127.0.0.1:8000/

use a db-dump

  • get a dump
  • create a new postgres-db name e.g. mmp
  • create postgis-extension
  • restore db-dump
  • make sure your (local) settings-file matches your db-settings (should be the case if you use the checked in pg_local.py settings file and if you named your db mmp)
  • start dev-server python manage.py runserver ---settings=djangobaseproject.settings.pg_local

[optional] populate netvis-cache

  • run something like python manage.py populate_netvis_cache <app_name> <model_name>

    • python manage.py populate_netvis_cache archiv autor --settings=djangobaseproject.settings.pg_local
  • go to http://127.0.0.1:8000/netvis/archiv/autor to the see the corresponding generic netvis

building the image

docker build -t mmp:latest . docker build -t mmp:latest --no-cache .

running the image

To run the image you should provide an .env file to pass in needed environment variables; see example below:

DB_NAME=mmp
DB_USER=mmp
DB_PASSWORD=db_pw
PROJECT_NAME=mmp
SECRET_KEY=randomstring
DEBUG=True
DJANGO_SUPERUSER_USERNAME=user_name
DJANGO_SUPERUSER_PASSWORD=user_pw
VOCABS_DEFAULT_PEFIX=mmp
VOCABS_DEFAULT_PEFIX=en
REDMINE_ID=12345

docker run -it -p 8020:8020 --rm --env-file .env_dev mmp:latest

or use published image:

docker run -it -p 8020:8020 --rm --env-file .env_dev acdhch/mmp:latest

dev notes

python manage.py remove_stale_contenttypes

cheat sheet

http://127.0.0.1:8000/archiv-ac/schlagwort-autocomplete/ http://127.0.0.1:8000/archiv-ac/eigenname-autocomplete/ http://127.0.0.1:8000/story-maps/data/1/

http://127.0.0.1:8000/api/stelle/?key_word__art=Schlagwort http://127.0.0.1:8000/api/stelle/?key_word__art=Eigenname http://127.0.0.1:8000/api/keyword/?art=Eigenname 127.0.0.1:8000/api/keyword/?art=Schlagwort