6 technical documentation
mpeltriaux edited this page 2023-03-24 08:35:15 +01:00

Technical documentation

Dependencies

There are certain dependencies for konova:

  • Postgresql and initial setup
    • An instance of a postgresql server must be reachable
    • The database defined in django_settings.py must exist (default 'konova')
    • All django migrations need to be migrated into the database (python manage.py migrate)
    • The initial setup command needs to be run once after successful migration (python manage.py setup)
  • Virtualenv
    • Konova is a python project, therefore a virtual environment has to be created (>=python3.7) and used for the project
      • This becomes obsolet in case of docker container based deployment
  • PIP
    • All python dependency requirements need to be fullfiled (pip install -r requirements.txt)
      • Run command in virtualenv (or docker container)!
  • Redis and celery
    • An instance of a redis server must be reachable
    • The configuration for a broker defined in celery.py needs to point to redis
    • Background processes need to be started (celery -A konova worker -l INFO)
      • More info here
      • Keep in mind that each background process is an instance of konova itself!
  • Codelists
    • All codes that are used in konova (registration offices, biotope types, ...) are fetched from the rlp own public list of osiris keys (e.g. https://codelisten.naturschutz.rlp.de/repository/referenzliste/903)
    • Codes can be fetched using the custom command found in app codelist in konova (python manage.py update_codelist)
      • This should be run once a night, e.g. using cron as scheduler
  • Parcel intersectioning
    • Entries that are create or edited and hold a geometry will try to resolve the legal parcel information using the geometry
    • The application Schneider provides such functionalities and lives on lanis-gov02
      • More info on Schneider can be found here
  • E-Mail sending
    • An instance of any smtp server must be reachable (e.g. LDI own)
    • To be able to send any mails, the proper configurations must be set in django_settings.py (e.g. EMAIL_HOST, EMAIL_PORT, ...)

API

All details regarding the API can be found here.

News and ServerMessages

News can be added to the landing page of every user by adding new entries for the model ServerMessage on the admin backend. Each entries behaviour can be configured using the attributes:

  • is_active
    • Toggles the visibility of a message. If false, the message will not be displayed on any landing page.
  • publish_on
    • The message will appear on landing pages once this timestamp has been reached.
  • unpublish_on (optional)
    • The message will disappear from landing pages once this timestamp has been reached
    • If no value is provided, the message will stay forever
  • importance
    • Select a level of importance from the given options
    • Depending on the selected level, other styles will be used to highlight the message entry on the landing pages
      • standard --> regular, no specific background color
      • info --> informative, light blue background color
      • warning --> warning, light red background color

Restoring deleted entries

All major entries (EIV, KOM, EMA, OEK) can be restored if they have been 'deleted' by a user. On the backend admin: Mark the entry using the checkbox and select from the drop-down menu the restore-deleted-entry action.

Errors

If any errors occur on the deployed system, the error will automatically been sent to all mail addresses that are defined as ADMINS in django_settings.py.