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.0.tar.gz (2.8 kB view hashes)

Uploaded Source

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