Django plugin for interacting with a Dagster server
Project description
django-dagster
A Django plugin for interacting with a Dagster server through the Django admin interface.
Features
- Native Django Admin integration — shows up as a Dagster section
- List all jobs from connected Dagster instance
- View runs with status and job filtering
- Trigger new job executions with optional JSON run config
- Cancel running jobs
- Re-execute failed/canceled jobs
- View detailed run metadata (config, tags, event logs)
- Granular permission system using Django's built-in permissions
Screenshots
| Jobs list | Job detail |
|---|---|
| Trigger job | Trigger success |
|---|---|
| Runs list | Run detail |
|---|---|
Requirements
- Python 3.10+
- Django 4.2+
Installation
pip install django-dagster
Configuration
Add django_dagster to INSTALLED_APPS and set DAGSTER_URL in your Django settings:
INSTALLED_APPS = [
...
"django_dagster",
]
DAGSTER_URL = "http://localhost:3000"
Then run migrations to create the permission models:
python manage.py migrate django_dagster
No URL configuration or manual admin registration is needed. Navigate to /admin/ and look for the Dagster section.
Permissions
Access is governed by standard Django permissions that you can assign to users or groups via the Django admin. Superusers always have full access.
| Permission | Codename | Grants access to |
|---|---|---|
| Can view Job | view_dagsterjob |
View job list and job detail pages |
| Can view Run | view_dagsterrun |
View run list and run detail pages |
| Can trigger Dagster jobs | trigger_dagsterjob |
Trigger/submit a new job run |
| Can cancel Dagster runs | cancel_dagsterrun |
Cancel a running job |
| Can re-execute Dagster runs | reexecute_dagsterrun |
Re-execute a completed/failed run |
| Can access the Dagster UI | access_dagster_ui |
Show direct links to the Dagster UI |
To customise behaviour — for example, granting all staff users full access by default — unregister the defaults and register your own subclass in your project's admin.py:
from django.contrib import admin
from django_dagster.admin import DagsterJobAdmin, DagsterRunAdmin
from django_dagster.models import DagsterJob, DagsterRun
def _is_active_staff(request):
return request.user.is_active and request.user.is_staff
class MyDagsterJobAdmin(DagsterJobAdmin):
def has_module_permission(self, request):
return _is_active_staff(request)
def has_view_permission(self, request, obj=None):
return _is_active_staff(request)
def has_trigger_dagsterjob_permission(self, request):
return _is_active_staff(request)
def has_access_dagster_ui_permission(self, request):
return _is_active_staff(request)
class MyDagsterRunAdmin(DagsterRunAdmin):
def has_module_permission(self, request):
return _is_active_staff(request)
def has_view_permission(self, request, obj=None):
return _is_active_staff(request)
def has_cancel_dagsterrun_permission(self, request):
return _is_active_staff(request)
def has_reexecute_dagsterrun_permission(self, request):
return _is_active_staff(request)
def has_access_dagster_ui_permission(self, request):
return _is_active_staff(request)
admin.site.unregister(DagsterJob)
admin.site.unregister(DagsterRun)
admin.site.register(DagsterJob, MyDagsterJobAdmin)
admin.site.register(DagsterRun, MyDagsterRunAdmin)
Programmatic API
The package exposes Django model-like objects for use outside the admin:
from django_dagster import DagsterJob, DagsterRun
# List all jobs
jobs = DagsterJob.objects.all()
# Get a specific job (requires the repository and location names)
job = DagsterJob.objects.get(
name="etl_pipeline",
repository="__repository__",
location="my_location",
)
# Trigger a job
run_id = job.submit(run_config={"ops": {"my_op": {"config": {"x": 1}}}})
# Get default run config
config = job.get_default_run_config()
# List runs (with optional filtering)
runs = DagsterRun.objects.all()
runs = DagsterRun.objects.filter(job_name="etl_pipeline", statuses=["SUCCESS"])
# Get a specific run
run = DagsterRun.objects.get(run_id="abc123")
# Cancel / re-execute a run
run.cancel()
new_run_id = run.reexecute()
# Get event logs
events = run.get_events()
Demo
A self-contained demo project is available in the demo/ directory with sample Dagster jobs and pre-configured users. See demo/README.md for instructions.
License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_dagster-0.2.0.tar.gz.
File metadata
- Download URL: django_dagster-0.2.0.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0dac66cfb320885aeb15d17019e08e8fdc18925a5c1ab39df896bda23c6a6726
|
|
| MD5 |
5bd6d8ef3e07533c2d765ca944f8db88
|
|
| BLAKE2b-256 |
5050862b4093db87ece38432c8993f2ea0c1e7b01a9a310e20632e54135239f9
|
Provenance
The following attestation bundles were made for django_dagster-0.2.0.tar.gz:
Publisher:
ci-cd.yml on rclement/django-dagster
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_dagster-0.2.0.tar.gz -
Subject digest:
0dac66cfb320885aeb15d17019e08e8fdc18925a5c1ab39df896bda23c6a6726 - Sigstore transparency entry: 1285702957
- Sigstore integration time:
-
Permalink:
rclement/django-dagster@14d8b6531cc962580614f3a279d20a83ca42e755 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/rclement
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@14d8b6531cc962580614f3a279d20a83ca42e755 -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_dagster-0.2.0-py3-none-any.whl.
File metadata
- Download URL: django_dagster-0.2.0-py3-none-any.whl
- Upload date:
- Size: 26.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
940e06b76d948ef4114a4ee795c088b910004cbc1a2465992858e74870b9f39a
|
|
| MD5 |
3f998470bef04c04494852d0cb7ab8d0
|
|
| BLAKE2b-256 |
4581b32a2b1e5d7a50d1b874e6ab0529becc59b9936f492c217c6c9fbb258077
|
Provenance
The following attestation bundles were made for django_dagster-0.2.0-py3-none-any.whl:
Publisher:
ci-cd.yml on rclement/django-dagster
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_dagster-0.2.0-py3-none-any.whl -
Subject digest:
940e06b76d948ef4114a4ee795c088b910004cbc1a2465992858e74870b9f39a - Sigstore transparency entry: 1285703292
- Sigstore integration time:
-
Permalink:
rclement/django-dagster@14d8b6531cc962580614f3a279d20a83ca42e755 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/rclement
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@14d8b6531cc962580614f3a279d20a83ca42e755 -
Trigger Event:
push
-
Statement type: