Installation¶
To install the mde-thredds package for your Django project, you need to follow two steps:
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¶
git clone
https://codebase.helmholtz.cloud/model-data-explorer/mde-thredds.git
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>
create a postgres database named
mde_dev
(see settings.py for the exact settings)
run
python manage.py makemigrations
run
python manage.py migrate
Create a super user for django administration with
python manage.py createsuperuser
execute
python manage.py runserver
to run django server. (launch it usingsudo
if TDS was installed as root)run
python manage.py qcluster
if you decided to use Thredds restart schedulerinstall and run redis before running the django app (Mac:
brew install redis
and Linux:sudo apt-get install redis
)
experiment with the models via
python manage.py shell
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:
Add the
mde_thredds
,mde_core
,guardian
, anddjango_q
app to your INSTALLED_APPSin your projects urlconf, add include
mde_thredds.urls
via:from django.urls import include, path urlpatterns += [ path("mde-thredds/", include("mde_thredds.urls")), ]
Run
python manage.py migrate
to add models to your databaseConfigure 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.