Skip to main content

No project description provided

Project description

Installation

$ pip install django-command-stdout

settings.py

INSTALLED_APPS+=['django_command_stdout']

migrate

$ python manage.py migrate

Examples

@command_stdout decorator

from django_command_stdout.decorators import command_stdout

class Command(BaseCommand):
    @command_stdout
    def handle(self,*args,**options):

BaseCommand

import io
from django.core.management.base import BaseCommand
from django_command_stdout.models import Stdout

class Command(BaseCommand):
    def execute(self, *args, **options):
        command = type(self).__module__.split('.')[-1]
        with io.StringIO() as f:
            super().execute(*args, stdout=f,**options)
            Stdout(command=command,stdout=f.getvalue()).save()

call_command

from django_command_stdout.utils import call_command

call_command('name',*args,**options)

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_command_stdout-0.0.1.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file django_command_stdout-0.0.1.tar.gz.

File metadata

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

File hashes

Hashes for django_command_stdout-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1076b510e90066d8d301be8b7632eab8e8ffd8d48549ee98c1d99244380301f8
MD5 71ebbcf63e3b66ad4faca2093e45cd1f
BLAKE2b-256 132b4fbfc5cfd23d22fe7a44102b1e02e89264bee44fbe8a9eea3303b8ce7cb3

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