Missing Django integration for Inngest
Project description
Django Inngest
Missing Django integration for Inngest. This package depends on the Inngest Python SDK (pypi)
Installation
uv add inngest django-inngest
Configuration
Update urls.py to include:
from django.contrib import admin
from django.urls import path, include
from django_inngest.urls import inngest_urls
urlpatterns = [
# ...
path("admin", admin.site.urls),
# ...
]
# uses DJANGO_INNGEST_SERVE_PATH from settings.py
urlpatterns += inngest_urls
Update settings.py to include:
# required for inngest and production
INNGEST_EVENT_KEY = os.environ.get("INNGEST_EVENT_KEY", None)
INNGEST_SIGNING_KEY = os.environ.get("INNGEST_SIGNING_KEY", None)
# configuration
DJANGO_INNGEST_APP_ID = os.environ.get("DJANGO_INNGEST_APP_ID", "my-django-project")
DJANGO_INNGEST_IS_PRODUCTION = not DEBUG
DJANGO_INNGEST_CLIENT_LOGGER = os.environ.get(
"DJANGO_INNGEST_CLIENT_LOGGER", "gunicorn"
)
DJANGO_INNGEST_INACTIVE_FUNCTION_IDS = os.environ.get(
"DJANGO_INNGEST_INACTIVE_FUNCTION_IDS", []
)
DJANGO_INNGEST_AUTO_DISCOVER_FUNCTIONS = os.environ.get(
"DJANGO_INNGEST_AUTO_DISCOVER_FUNCTIONS", True
)
# no trailing slash or leading slash
DJANGO_INNGEST_SERVE_PATH = os.environ.get("DJANGO_INNGEST_SERVE_PATH", "api/inngest")
Usage
Create a new Django app and workflows file:
python manage.py startapp myapp
touch myapp/workflows.py
Update INSTALLED_APPS to include myapp.
In myapp/workflows.py, create a new Inngest function:
from datetime import timedelta
import inngest
from django_inngest.client import inngest_client
@inngest_client.create_function(
id="myapp/my-function",
trigger=inngest.TriggerEvent(name="my/trigger/event"),
rate_limit=inngest.RateLimit(
limit=1,
period=timedelta(minutes=2, seconds=30),
key="event.data.channel_id",
),
)
def my_function(ctx: inngest.Context):
print(ctx.event.data.get("channel_id"))
# your inngest function logic here
return "OK"
Then trigger anywhere in your Django project with:
import inngest
from django_inngest.client import inngest_client
event = inngest.Event(
name="my/trigger/event",
data={"channel_id": "1234567890"},
)
inngest_client.send(event)
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_inngest-0.0.7.tar.gz.
File metadata
- Download URL: django_inngest-0.0.7.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa7a13a3d2c744cdbb4b7abb5115ff04e6d153be3a680756cf6ca29bf68b50be
|
|
| MD5 |
396e5a15d2218c2d1e1e0726b7722e18
|
|
| BLAKE2b-256 |
5fc84f4b0939af0f0a25c02385059fda6a66828e2e247b472320465eaff83841
|
Provenance
The following attestation bundles were made for django_inngest-0.0.7.tar.gz:
Publisher:
main.yaml on jmitchel3/django-inngest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_inngest-0.0.7.tar.gz -
Subject digest:
aa7a13a3d2c744cdbb4b7abb5115ff04e6d153be3a680756cf6ca29bf68b50be - Sigstore transparency entry: 697272111
- Sigstore integration time:
-
Permalink:
jmitchel3/django-inngest@71f4d2c6d491d5f20f561c664b24a74320fa9cd3 -
Branch / Tag:
refs/tags/v0.0.7 - Owner: https://github.com/jmitchel3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yaml@71f4d2c6d491d5f20f561c664b24a74320fa9cd3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_inngest-0.0.7-py3-none-any.whl.
File metadata
- Download URL: django_inngest-0.0.7-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
404eff1cab0a3ac2c5aa2bda59130984314e3b2b7d4224bf6c848a0aee72a3fe
|
|
| MD5 |
050808acba615cccb398d34ccc0534ad
|
|
| BLAKE2b-256 |
51ef66e235a47e8bab677147919386fdc253b87b69caedfc29b5825a37efcd9a
|
Provenance
The following attestation bundles were made for django_inngest-0.0.7-py3-none-any.whl:
Publisher:
main.yaml on jmitchel3/django-inngest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_inngest-0.0.7-py3-none-any.whl -
Subject digest:
404eff1cab0a3ac2c5aa2bda59130984314e3b2b7d4224bf6c848a0aee72a3fe - Sigstore transparency entry: 697272139
- Sigstore integration time:
-
Permalink:
jmitchel3/django-inngest@71f4d2c6d491d5f20f561c664b24a74320fa9cd3 -
Branch / Tag:
refs/tags/v0.0.7 - Owner: https://github.com/jmitchel3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yaml@71f4d2c6d491d5f20f561c664b24a74320fa9cd3 -
Trigger Event:
push
-
Statement type: