Installation

To install the mde-thredds package for your Django project, you need to follow two steps:

  1. Install the package

  2. Add the app to your Django project

Installation from PyPi

The recommended way to install this package is via pip and PyPi via:

pip install mde-thredds

Or install it directly from the source code repository on Gitlab via:

pip install git+https://gitlab.hzdr.de/model-data-explorer/mde-thredds.git

Also for running mde-thredds you have to complete configuration in install-django-app or replace settings.py with the current settings.py file of your project.

The latter should however only be done if you want to access the development versions.

Installation for development

  1. git clone https://codebase.helmholtz.cloud/model-data-explorer/mde-thredds.git

  2. run pip install -r requirements.txt

    • If you have trouble installing psycopg2-binary, install postgresql first, and then use the following command to add the following location to the PATH environment variable: export PATH=$PATH:<bin directory of postgresql>

  3. create a postgres database named mde_dev (see settings.py for the exact settings)

  1. run python manage.py makemigrations

  2. run python manage.py migrate

  3. Create a super user for django administration with python manage.py createsuperuser

  4. execute python manage.py runserver to run django server. (launch it using sudo if TDS was installed as root)

  5. run python manage.py qcluster if you decided to use Thredds restart scheduler

    • install and run redis before running the django app (Mac: brew install redis and Linux: sudo apt-get install redis)

  6. experiment with the models via python manage.py shell

  7. for monitoring the scheduler run python manage.py qmonitor

Please head over to our contributing guide for installation instruction for development.

Installing using Docker

To be developed

Install the Django App for your project

To use the mde-thredds package in your Django project, you need to add the app to your INSTALLED_APPS, configure your urls.py, run the migration, add a login button in your templates. Here are the step-by-step instructions:

  1. Add the mde_thredds, mde_core, guardian, and django_q app to your INSTALLED_APPS

  2. in your projects urlconf, add include mde_thredds.urls via:

    from django.urls import include, path
    
    urlpatterns += [
        path("mde-thredds/", include("mde_thredds.urls")),
     ]
    
  3. Run python manage.py migrate to add models to your database

  4. Configure the app to your needs (see Configuration options).

That’s it! For further adaption to you Django project, please head over to the Configuration options. You can also have a look into the testproject in the source code repository for a possible implementation.