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.23.tar.gz
(27.0 kB
view details)
Built Distribution
File details
Details for the file django_i3tasks-0.0.23.tar.gz
.
File metadata
- Download URL: django_i3tasks-0.0.23.tar.gz
- Upload date:
- Size: 27.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f77a9411399a2602cf3e168637a6262e1979fc599b63960f2d982f360c4bbe5 |
|
MD5 | d78ef4759aaad8d265fb1a84bea5b04e |
|
BLAKE2b-256 | 392e32a0850a2e7e813b4eff8b6e9c2755c1e58ad5258e712272a03b37912171 |
File details
Details for the file django_i3tasks-0.0.23-py3-none-any.whl
.
File metadata
- Download URL: django_i3tasks-0.0.23-py3-none-any.whl
- Upload date:
- Size: 31.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8835de3742f2d854aca243de667cc067bd712d7669f3f5d2d2c69b4102412c4 |
|
MD5 | 5c5a637ca3e0224a35a58fe798ba9d0a |
|
BLAKE2b-256 | 822f657b93c6ca70c7aa4701bee646ace29e5e49c01060652134c34c8d0642b5 |