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
messageslogging.conf
autoload (if exists)
aiohttp_rq_bridge
worker commandaiohttp_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
File details
Details for the file django_aiohttp_rq-0.0.6.tar.gz
.
File metadata
- Download URL: django_aiohttp_rq-0.0.6.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bbf20d4d9151e9df4a2cc8e6a1920ea0806400259757c81c1188065c2fdd661 |
|
MD5 | 63541146e8da359d2a02d983d888bf52 |
|
BLAKE2b-256 | 9384e1733323f4419047d7f4e6546bc50bda94ac046630025806de4b7d5b7d4b |