(installation)= # Installation ```{warning} This page has been automatically generated as has not yet been reviewed by the authors of dasf-broker-django! ``` To install the `dasf-broker-django` package for your Django project, you need to follow two steps: 1. {ref}`Install the package ` 2. {ref}`Add the app to your Django project ` (install-package)= ## Installation from PyPi The recommended way to install this package is via pip and PyPi via: ```bash pip install dasf-broker-django ``` or, if you are using `pipenv`, via: ```bash pipenv install dasf-broker-django ``` Or install it directly from [the source code repository on Gitlab][source code repository] via: ```bash pip install git+https://codebase.helmholtz.cloud/dasf/dasf-broker-django.git ``` The latter should however only be done if you want to access the development versions (see {ref}`install-develop`). (install-django-app)= ## Install the Django App for your project To use the `dasf-broker-django` 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 `dasf_broker` app to your `INSTALLED_APPS` 2. in your projects urlconf (see {setting}`ROOT_URLCONF`), add include {mod}`dasf_broker.urls` via:: ```python from django.urls import include, path urlpatterns += [ path("dasf-broker-django/", include("dasf_broker.urls")), ] ``` 3. Run ``python manage.py migrate`` to add models to your database 4. Configure the app to your needs (see {ref}`configuration`) (you can also have a look into the `testproject` folder in the [source code repository][source code repository] for a possible configuration). Please make sure that you have an `asgi.py` file as in the `testproject` and set the `ASGI_APPLICATION` variable in your `settings.py`. See https://channels.readthedocs.io/en/stable/installation.html If you need a deployment-ready django setup for an app like this, please have a look at the following template: https://codebase.helmholtz.cloud/hcdc/software-templates/django-channels-docker-template That's it! [source code repository]: https://codebase.helmholtz.cloud/dasf/dasf-broker-django (install-develop)= ## Installation for development Please head over to our `contributing guide `{.interpreted-text role="ref"} for installation instruction for development.