django-qstash 0.1.1__py3-none-any.whl → 0.1.3__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 +1 -1
- django_qstash/client.py +8 -4
- {django_qstash-0.1.1.dist-info → django_qstash-0.1.3.dist-info}/METADATA +22 -6
- {django_qstash-0.1.1.dist-info → django_qstash-0.1.3.dist-info}/RECORD +6 -6
- {django_qstash-0.1.1.dist-info → django_qstash-0.1.3.dist-info}/WHEEL +1 -1
- {django_qstash-0.1.1.dist-info → django_qstash-0.1.3.dist-info}/top_level.txt +0 -0
django_qstash/__init__.py
CHANGED
django_qstash/client.py
CHANGED
|
@@ -2,12 +2,14 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
4
|
import warnings
|
|
5
|
+
from urllib.parse import urlparse
|
|
5
6
|
|
|
6
7
|
from qstash import QStash
|
|
7
8
|
|
|
8
9
|
from django_qstash.settings import QSTASH_TOKEN
|
|
9
10
|
|
|
10
11
|
QSTASH_URL = os.environ.get("QSTASH_URL", None)
|
|
12
|
+
UPSTASH_QSTASH_DOMAINS = ["upstash.io", "upstash.cloud", "upstash.com"]
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
def init_qstash():
|
|
@@ -15,10 +17,12 @@ def init_qstash():
|
|
|
15
17
|
"token": QSTASH_TOKEN,
|
|
16
18
|
}
|
|
17
19
|
if QSTASH_URL is not None:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
domain = urlparse(QSTASH_URL).netloc
|
|
21
|
+
if domain.split(".")[-2:] not in UPSTASH_QSTASH_DOMAINS:
|
|
22
|
+
warning_msg = f"\n\n\033[93mUsing {QSTASH_URL} as your QStash URL. \
|
|
23
|
+
\nThis configuration should only be used in development.\n\033[0m"
|
|
24
|
+
warnings.warn(warning_msg, RuntimeWarning, stacklevel=2)
|
|
25
|
+
kwargs["base_url"] = QSTASH_URL
|
|
22
26
|
return QStash(**kwargs)
|
|
23
27
|
|
|
24
28
|
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: django-qstash
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
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
|
|
7
7
|
Project-URL: Documentation, https://github.com/jmitchel3/django-qstash
|
|
8
8
|
Project-URL: Funding, https://github.com/jmitchel3/django-qstash
|
|
9
9
|
Project-URL: Repository, https://github.com/jmitchel3/django-qstash
|
|
10
|
-
Classifier: Development Status ::
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
11
|
Classifier: Framework :: Django :: 4.2
|
|
12
12
|
Classifier: Framework :: Django :: 5.0
|
|
13
13
|
Classifier: Framework :: Django :: 5.1
|
|
14
|
+
Classifier: Framework :: Django :: 5.2
|
|
14
15
|
Classifier: Intended Audience :: Developers
|
|
15
16
|
Classifier: License :: OSI Approved :: MIT License
|
|
16
17
|
Classifier: Natural Language :: English
|
|
@@ -24,7 +25,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
|
24
25
|
Requires-Python: >=3.10
|
|
25
26
|
Description-Content-Type: text/markdown
|
|
26
27
|
Requires-Dist: django>=4.2
|
|
27
|
-
Requires-Dist: qstash
|
|
28
|
+
Requires-Dist: qstash<3,>=2
|
|
28
29
|
Requires-Dist: requests>=2.30
|
|
29
30
|
|
|
30
31
|
# django-qstash
|
|
@@ -64,10 +65,25 @@ This allows us to:
|
|
|
64
65
|
- Trigger GitHub Actions Workflows or GitLab CI/CD pipelines for handling other kinds of background tasks based on our project's code.
|
|
65
66
|
|
|
66
67
|
|
|
68
|
+
## Demo
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Django QStash in 3 Minutes on YouTube
|
|
72
|
+
|
|
73
|
+
[](https://www.youtube.com/watch?v=e-hloBp4eVQ)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### Mini Course on YouTube
|
|
77
|
+
|
|
78
|
+
Step-by-Step [tutorial playlist on YouTube](https://www.youtube.com/playlist?list=PLEsfXFp6DpzQgNC8Q_ijgqxCVRtSC4_-L) on my [@CodingEntrepreneurs](https://cfe.sh/youtube) Youtube channel.
|
|
79
|
+
|
|
67
80
|
## Table of Contents
|
|
68
81
|
|
|
69
82
|
- [django-qstash](#django-qstash)
|
|
70
83
|
- [How it works](#how-it-works)
|
|
84
|
+
- [Demo](#demo)
|
|
85
|
+
- [Django QStash in 3 Minutes on YouTube](#django-qstash-in-3-minutes-on-youtube)
|
|
86
|
+
- [Mini Course on YouTube](#mini-course-on-youtube)
|
|
71
87
|
- [Table of Contents](#table-of-contents)
|
|
72
88
|
- [Installation](#installation)
|
|
73
89
|
- [Using Pip](#using-pip)
|
|
@@ -450,8 +466,8 @@ desired_task = "django_qstash.results.clear_stale_results_task"
|
|
|
450
466
|
# or desired_task = "example_app.tasks.my_task"
|
|
451
467
|
|
|
452
468
|
task_to_use = desired_task
|
|
453
|
-
if desired_task not in
|
|
454
|
-
task_to_use =
|
|
469
|
+
if desired_task not in all_available_tasks:
|
|
470
|
+
task_to_use = all_available_tasks[0]
|
|
455
471
|
|
|
456
472
|
print(f"Using task: {task_to_use}")
|
|
457
473
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
django_qstash/__init__.py,sha256=
|
|
1
|
+
django_qstash/__init__.py,sha256=0veh8-zYPbcj23kwahKAD74-FZZHVoCWCZaZQcn0eJ0,187
|
|
2
2
|
django_qstash/callbacks.py,sha256=IQ-D8sPlSRuREZ1zwkRyd2GtxfmrJJh2x4jLd39rZCE,813
|
|
3
|
-
django_qstash/client.py,sha256=
|
|
3
|
+
django_qstash/client.py,sha256=CXN9JfUmbmVdlwWO1XLhhsKBPJx0qIqsnAyC3t5Rh7U,844
|
|
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
|
|
@@ -46,7 +46,7 @@ django_qstash/schedules/migrations/0001_initial.py,sha256=66cA8xnJV3h7QgzCaOiv-N
|
|
|
46
46
|
django_qstash/schedules/migrations/0002_taskschedule_updated_at.py,sha256=6hZO0a9P2ZpOROkk7O5UXBhahghU0QfxZl4E-c3HKGw,459
|
|
47
47
|
django_qstash/schedules/migrations/0003_alter_taskschedule_cron.py,sha256=oBW_FcvosKsa0l_l3eVDRIZli5K1wQaN_DJjamVe23s,826
|
|
48
48
|
django_qstash/schedules/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
|
-
django_qstash-0.1.
|
|
50
|
-
django_qstash-0.1.
|
|
51
|
-
django_qstash-0.1.
|
|
52
|
-
django_qstash-0.1.
|
|
49
|
+
django_qstash-0.1.3.dist-info/METADATA,sha256=7beuRC4rOg4r3Orh7igWZN2V4GfdOiTImZHzmSvGEJk,21868
|
|
50
|
+
django_qstash-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
51
|
+
django_qstash-0.1.3.dist-info/top_level.txt,sha256=AlV3WSK1A0ZvKuCLsINtIJhJW8zo7SEB-D3_RAjZ0hI,14
|
|
52
|
+
django_qstash-0.1.3.dist-info/RECORD,,
|
|
File without changes
|