Django app for manage async tasks by http requests
Project description
django-i3tasks
Django app for manage async tasks by http requests
to install
pip install django-i3tasks
Quick start
-
Add "polls" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [ ..., "django_i3tasks", ]
-
Include the polls URLconf in your project urls.py like this::
from django.urls import path from django_i3tasks import views as i3tasks_views path("i3/tasks-beat", i3tasks_views.BeatTaskView.as_view()), path("i3/tasks-beat/", i3tasks_views.BeatTaskView.as_view()), path("i3/tasks-push", i3tasks_views.PushedTaskView.as_view()), path("i3/tasks-push/", i3tasks_views.PushedTaskView.as_view()),
-
Run
python manage.py migrate
to create the models. -
local example settings
from django_i3tasks.types import I3TasksSettings, Queue, Schedule PUBSUB_CONFIG = { "EMULATOR": True, # "EMULATOR": False, "HOST": "pwd-pub-sub-emu:9085", # "NAMESPACE": "creators-area-back", # "DEFAULT_TOPIC_QUEUE_NAME": "default", # "DEFAULT_TOPIC_SUBSCRIPTION_NAME": "default", # "PUSH_ENDPOINT": "http://pwd-backend:9577/i3/tasks-push/", "PROJECT_ID": "i3idea", "CREDENTIALS": False, # "PROJECT_ID": 'hoopygang-158809', # "CREDENTIALS": "/app/service_accounts/creators-area-backend-pubsub.json" } I3TASKS = I3TasksSettings( namespace=f"tasks.{SHORT_PROJECT_NAME}", default_queue=Queue( queue_name="default", subscription_name="default", push_endpoint="http://pwd-backend:9577/i3/tasks-push/", ), other_queues=( ), schedules=( Schedule( module_name='django_i3tasks.tasks', func_name='test_task', cron='* * * * *', args=[], kwargs={}, ), ) )
-
production example settings
from django_i3tasks.types import I3TasksSettings, Queue, Schedule PUBSUB_CONFIG = { # "EMULATOR": True, "EMULATOR": False, # "HOST": "pwd-pub-sub-emu:9085", # "NAMESPACE": "creators-area-back", # "DEFAULT_TOPIC_QUEUE_NAME": "default", # "DEFAULT_TOPIC_SUBSCRIPTION_NAME": "default", # "PUSH_ENDPOINT": "http://pwd-backend:9577/i3/tasks-push/", "PROJECT_ID": "i3idea", # "CREDENTIALS": True, # "PROJECT_ID": 'hoopygang-158809', "CREDENTIALS": "/app/conf/pwd-backend-pubsub.json" } I3TASKS = I3TasksSettings( namespace=f"tasks.{SHORT_PROJECT_NAME}", default_queue=Queue( queue_name="default", subscription_name="default", push_endpoint="https://prowodo-back-tasks-tqhjqw4diq-no.a.run.app/i3/tasks-push/", ), other_queues=( ), schedules=( Schedule( module_name='django_i3tasks.tasks', func_name='test_task', cron='* * * * *', args=[], kwargs={}, ), ) )
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django_i3tasks-0.0.14.tar.gz
(22.6 kB
view details)
Built Distribution
File details
Details for the file django_i3tasks-0.0.14.tar.gz
.
File metadata
- Download URL: django_i3tasks-0.0.14.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 567df1c4e08387aadcf2a2dbd9e9878aeda80971827518e2ce2fd496b530fb47 |
|
MD5 | 9226d8c8fd6eac89e3592c020b5943df |
|
BLAKE2b-256 | 3ded38aa38f851727e341be90b3e312a7542898a4a3a8c9b409ea3b430b3743e |
File details
Details for the file django_i3tasks-0.0.14-py3-none-any.whl
.
File metadata
- Download URL: django_i3tasks-0.0.14-py3-none-any.whl
- Upload date:
- Size: 24.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8725b8d1f29c6f401f5164660d995e0f4846fad85a3a59cebe6bc0dea88c36a |
|
MD5 | 47ef801d6c825a62d222df9840d1e99b |
|
BLAKE2b-256 | 4f46d9043c51465656fa15f0131787a283aa9d661c92ec3e91c6f3296a642af5 |