django-qstash 0.0.12__py3-none-any.whl → 0.0.14__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of django-qstash might be problematic. Click here for more details.

django_qstash/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.0.12"
3
+ __version__ = "0.0.14"
4
4
 
5
5
  from django_qstash.app import shared_task
6
6
  from django_qstash.app import stashed_task
@@ -0,0 +1,30 @@
1
+ # Generated by Django 5.1.4 on 2025-01-13 19:27
2
+
3
+ from __future__ import annotations
4
+
5
+ from django.db import migrations
6
+ from django.db import models
7
+
8
+ import django_qstash.schedules.validators
9
+
10
+
11
+ class Migration(migrations.Migration):
12
+ dependencies = [
13
+ ("django_qstash_schedules", "0002_taskschedule_updated_at"),
14
+ ]
15
+
16
+ operations = [
17
+ migrations.AlterField(
18
+ model_name="taskschedule",
19
+ name="cron",
20
+ field=models.CharField(
21
+ default="*/5 * * * *",
22
+ help_text="Cron expression for scheduling the task",
23
+ max_length=255,
24
+ validators=[
25
+ django_qstash.schedules.validators.validate_cron_expression
26
+ ],
27
+ verbose_name="Cron Expression",
28
+ ),
29
+ ),
30
+ ]
django_qstash/urls.py ADDED
@@ -0,0 +1,9 @@
1
+ from __future__ import annotations
2
+
3
+ from django.urls import path
4
+
5
+ from django_qstash.views import qstash_webhook_view
6
+
7
+ urlpatterns = [
8
+ path("", qstash_webhook_view),
9
+ ]
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: django-qstash
3
- Version: 0.0.12
3
+ Version: 0.0.14
4
4
  Summary: A drop-in replacement for Celery's shared_task with Upstash QStash.
5
5
  Author-email: Justin Mitchel <justin@codingforentrepreneurs.com>
6
6
  Project-URL: Changelog, https://github.com/jmitchel3/django-qstash
@@ -72,7 +72,7 @@ This allows us to:
72
72
  - [Installation](#installation)
73
73
  - [Using Pip](#using-pip)
74
74
  - [Update Settings (`settings.py`)](#update-settings-settingspy)
75
- - [Configure Webhook URL](#configure-webhook-url)
75
+ - [Configure QStash Webhook Handler](#configure-qstash-webhook-handler)
76
76
  - [Required Environment Variables](#required-environment-variables)
77
77
  - [Sample Project](#sample-project)
78
78
  - [Dependencies](#dependencies)
@@ -123,20 +123,27 @@ INSTALLED_APPS = [
123
123
  - `django_qstash.results` (Optional): Store task results in Django DB
124
124
  - `django_qstash.schedules` (Optional): Use QStash Schedules to run your `django_qstash` tasks. Out of the box support for _django_qstash_ `@stashed_task`. Schedule tasks using _cron_ (e.g. `0 0 * * *`) format which is required based on [QStash Schedules](https://upstash.com/docs/qstash/features/schedules). use [contrab.guru](https://crontab.guru/) for writing the cron format.
125
125
 
126
- ### Configure Webhook URL
126
+ ### Configure QStash Webhook Handler
127
+
128
+ Set it and forget it. `django_qstash` will handle the webhook from qstash automatically for you.
127
129
 
128
130
  In your `ROOT_URLCONF` (e.g. `urls.py`), add the following:
131
+
129
132
  ```python
130
- from django_qstash.views import qstash_webhook_view
133
+ from django.urls import include
131
134
 
132
135
  urlpatterns = [
133
136
  # ...
134
- path("qstash/webhook/", qstash_webhook_view),
137
+ path("qstash/webhook/", include("django_qstash.urls")),
135
138
  # ...
136
139
  ]
137
140
  ```
138
141
  Be sure to use this path in your `DJANGO_QSTASH_WEBHOOK_PATH` environment variable.
139
142
 
143
+
144
+ The `django_qstash` webhook handler runs your `@shared_task` or `@stashed_task` functions via the `importlib` module. In other words, you should not need to modify the webhook handler.
145
+
146
+
140
147
  ### Required Environment Variables
141
148
 
142
149
  Get your QStash token and signing keys from [Upstash](https://upstash.com/).
@@ -348,7 +355,7 @@ Various options are available to configure django-qstash.
348
355
 
349
356
  ### Example Django Settings
350
357
 
351
- For a complete example, review [sample_project/settings.py](sample_project/settings.py) where [python-decouple](https://github.com/henriquebastos/python-decouple) is used to set the environment variables via the `.env` file or system environment variables (for production use).
358
+ For a complete example, review [sample_project/cfehome/settings.py](sample_project/cfehome/settings.py) where [python-decouple](https://github.com/henriquebastos/python-decouple) is used to set the environment variables via the `.env` file or system environment variables (for production use).
352
359
 
353
360
  Using `os.environ`:
354
361
  ```python
@@ -1,10 +1,11 @@
1
- django_qstash/__init__.py,sha256=ENXrTf63lzkaRO580z6PPjYDS7bgC2bNaK24S-uqnbo,188
1
+ django_qstash/__init__.py,sha256=X2HLkTrz3IPvofXBeKHkAqkJR823w9SRbbhs8kjVL9A,188
2
2
  django_qstash/callbacks.py,sha256=IQ-D8sPlSRuREZ1zwkRyd2GtxfmrJJh2x4jLd39rZCE,813
3
3
  django_qstash/client.py,sha256=cgHf-g6lDAltY_Vt6GUVJNY2JSz1czBOHL-WVkkLs2M,149
4
4
  django_qstash/cron.py,sha256=13OzTMGXFgjNEXjs2Et20WGZYtW9lKlu79BjbRySnVc,716
5
5
  django_qstash/exceptions.py,sha256=pH6kKRJFIVFkDHUJQ9yRWmtGdBBSXpNAwMSFuNzMgPw,392
6
6
  django_qstash/handlers.py,sha256=TtYZ-Sr858ajISBpDuHIT7-qaVsoVfTE6vVFJ9-kpPE,5820
7
7
  django_qstash/settings.py,sha256=YvpXMo1AdIWvbotISWJmhg0vrW3A3UQ4BieNzMfRC7Y,524
8
+ django_qstash/urls.py,sha256=1dNblYOCIBdqSXbA1jSL9H0aiXN5gIDVwhfZeC4-DQw,172
8
9
  django_qstash/utils.py,sha256=wrTU30cobO2di18BNEFtKD4ih2euf7eQNpg6p6TkQ1Y,1185
9
10
  django_qstash/views.py,sha256=H32f_jGnlwOTO0YG9znNo2b-GRYZ8TM-Wt0T62SGdXM,639
10
11
  django_qstash/app/__init__.py,sha256=kmoCVoESInzCZ_oGUiPVY4GsFQwBC07cqFJCyn9Loyk,240
@@ -43,8 +44,9 @@ django_qstash/schedules/signals.py,sha256=g1aRAbZx-stnvD589mZagR6I27E56064fUyWsx
43
44
  django_qstash/schedules/validators.py,sha256=w1dLgf_rAujurcktGPgu1aXejT5BhH5ianKSr7cEYKU,2467
44
45
  django_qstash/schedules/migrations/0001_initial.py,sha256=66cA8xnJV3h7QgzCaOiv-Nu3Xl9IdZQPgQKhxyW3bs4,4516
45
46
  django_qstash/schedules/migrations/0002_taskschedule_updated_at.py,sha256=6hZO0a9P2ZpOROkk7O5UXBhahghU0QfxZl4E-c3HKGw,459
47
+ django_qstash/schedules/migrations/0003_alter_taskschedule_cron.py,sha256=oBW_FcvosKsa0l_l3eVDRIZli5K1wQaN_DJjamVe23s,826
46
48
  django_qstash/schedules/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
- django_qstash-0.0.12.dist-info/METADATA,sha256=NIxqfsPXtnoculriqbmMK9d_4PkFwvX-D2ey4U43hY0,19422
48
- django_qstash-0.0.12.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
49
- django_qstash-0.0.12.dist-info/top_level.txt,sha256=AlV3WSK1A0ZvKuCLsINtIJhJW8zo7SEB-D3_RAjZ0hI,14
50
- django_qstash-0.0.12.dist-info/RECORD,,
49
+ django_qstash-0.0.14.dist-info/METADATA,sha256=IwrF28uwoTMPK18baWNm_-T_8bHMB9GyHV-QFMgC-fE,19748
50
+ django_qstash-0.0.14.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
51
+ django_qstash-0.0.14.dist-info/top_level.txt,sha256=AlV3WSK1A0ZvKuCLsINtIJhJW8zo7SEB-D3_RAjZ0hI,14
52
+ django_qstash-0.0.14.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.7.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5