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.18.tar.gz
(24.8 kB
view details)
Built Distribution
File details
Details for the file django_i3tasks-0.0.18.tar.gz
.
File metadata
- Download URL: django_i3tasks-0.0.18.tar.gz
- Upload date:
- Size: 24.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60ffe123bf0eb072ae417bb9531f14fb2ff249061737e72a62d542c54aed867c |
|
MD5 | 9470c29d5ae18dbc52c0812275ba0fdd |
|
BLAKE2b-256 | 2c96d6839919c623995831fb6b8ba957c2564ca190880d342af13301b45c90eb |
File details
Details for the file django_i3tasks-0.0.18-py3-none-any.whl
.
File metadata
- Download URL: django_i3tasks-0.0.18-py3-none-any.whl
- Upload date:
- Size: 27.6 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 | 18e3a616e72665769cbdcf8b33b0849d1658e7e562374e8134d031a93e5cb65c |
|
MD5 | 84fe3b55f4cc75d12a141bc8c84ed685 |
|
BLAKE2b-256 | f4fa2d718455bde0743d5d1b7023159c1289b41b1e765f5a282d0c97e2c873d9 |