Skip to main content

Django redis Push Pull models and management commands

Project description

Installation

$ pip install django-aiohttp-rq

settings.py

INSTALLED_APPS+=['django_aiohttp_rq']

# optional
AIOHTTP_RQ_RESTART_INTERVAL=600
AIOHTTP_RQ_SLEEP_INTERVAL=0.1 # 0.1 default

# optional
AIOHTTP_RQ_REDIS_HOST = 'localhost'
AIOHTTP_RQ_REDIS_PORT = 'aiohttp-rq-request-exception'
AIOHTTP_RQ_RESPONSE_QUEUE = 'aiohttp-rq-response'

# optional
AIOHTTP_RQ_REQUEST_QUEUE = 'aiohttp-rq-request'
AIOHTTP_RQ_REQUEST_EXCEPTION_QUEUE = 'aiohttp-rq-request-exception'
AIOHTTP_RQ_RESPONSE_QUEUE = 'aiohttp-rq-response'

migrate

$ python manage.py migrate

Features

  • based on aiohttp-rq
  • push (Request)/pull (RequestException, Response) models
  • logging
    • logging.debug messages
    • logging.conf autoload (if exists)
  • aiohttp_rq_bridge worker command
    • aiohttp_rq_extra.py extra command created by
  • admin

Models

model db_table fields/columns
Request aiohttp_rq_request id,worker,name
RequestException aiohttp_rq_request_exception id,url,method,data,headers,allow_redirects,max_redirects
Response aiohttp_rq_response id,url,status,headers,content_path,created_at

Management commands

name description
aiohttp_rq_bridge aiohttp_rq bridge worker
aiohttp_rq_pull pull to RequestException and Response
aiohttp_rq_push push Request to AIOHTTP_RQ_REQUEST_QUEUE
aiohttp_rq_extra not implemented

Examples

$ python manage.py aiohttp_rq_bridge

aiohttp_rq_extra.py

# apps/aiohttp_rq_extra/management/commands/aiohttp_rq_extra.py
from django.core.management.base import BaseCommand
from django.db import connection

class Command(BaseCommand):
    def handle(self, *args, **options):
        cursor = connection.cursor()
        cursor.execute('CALL aiohttp_rq_extra()')

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_aiohttp_rq-0.0.5.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file django_aiohttp_rq-0.0.5.tar.gz.

File metadata

  • Download URL: django_aiohttp_rq-0.0.5.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for django_aiohttp_rq-0.0.5.tar.gz
Algorithm Hash digest
SHA256 ed4d719a595a566f1df185a34cf30ca57c0d4dd8d3d03544eac82e7dac3b31a6
MD5 0575059b67e3c36756b649bbc070e038
BLAKE2b-256 85060b1ebe1658fa30517bd6c73c2220cfeb0cc0e678645a1e9efc239b5dfebe

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