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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django_command_stdout-0.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e9ddf5018d1d2012dcb70853a80caeccf549b997fd0106567e7c08ff6310e51 |
|
MD5 | 7e94cff463ada2664952735ce386d021 |
|
BLAKE2b-256 | 5e943791b2c0d27a6b3f3c3d1fb7b3f08d27709fd667ba7e6fede38a21cc381f |