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.20.tar.gz
(25.7 kB
view details)
Built Distribution
File details
Details for the file django_i3tasks-0.0.20.tar.gz
.
File metadata
- Download URL: django_i3tasks-0.0.20.tar.gz
- Upload date:
- Size: 25.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 822129a578a49af1ab67011e59ca3c59e3b31c0d15debf93eea26899bfb61179 |
|
MD5 | 7a55d9b678a095f6fe07e40a21a39d6f |
|
BLAKE2b-256 | 3281b03e5e9ec7072d93a80a3c5eeae6c5545da5e9adedf932ff525cef18188e |
File details
Details for the file django_i3tasks-0.0.20-py3-none-any.whl
.
File metadata
- Download URL: django_i3tasks-0.0.20-py3-none-any.whl
- Upload date:
- Size: 29.1 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 | e74f2eead6dfd2d7d9eb5238a2f0e86d026396fd7fcdc72e1e5fa602e044b2b1 |
|
MD5 | 56ba82514a599fb1e3446635ba5d32df |
|
BLAKE2b-256 | 30422a242b3f7881f2f31a1cc10524b488a4a3a4d05ec2b2eb6303311bb3bb68 |