Skip to main content

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

  1. Add "polls" to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = [ ..., "django_i3tasks", ]

  2. 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()),
    
  3. Run python manage.py migrate to create the models.

  4. 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={},
            ),
        )
    )
    
  5. 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


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.16.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

django_i3tasks-0.0.16-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file django_i3tasks-0.0.16.tar.gz.

File metadata

  • Download URL: django_i3tasks-0.0.16.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for django_i3tasks-0.0.16.tar.gz
Algorithm Hash digest
SHA256 a557891410580c1691a960a890f64ab3b05db80d5516bc69b03b6cb8ed16344e
MD5 eb82e7db36d756906aad2bc596d1fdc9
BLAKE2b-256 b0ca44a7c1c4b32e6f04cdd60eab3f8a6d866628bc2a8a2a3359c91fee5b49e7

See more details on using hashes here.

File details

Details for the file django_i3tasks-0.0.16-py3-none-any.whl.

File metadata

File hashes

Hashes for django_i3tasks-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 0e3c4691d01d57cb5b4c0fde13e3a70a2ede990e2677d0cbb2c5ce49d130be35
MD5 c014bbbd01089ab9a248fe8a50b313eb
BLAKE2b-256 18587a9fb969a0edfca9fe8b580564bea71389bb8204dbc3f84b91367b9ae1fe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page