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
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1076b510e90066d8d301be8b7632eab8e8ffd8d48549ee98c1d99244380301f8 |
|
MD5 | 71ebbcf63e3b66ad4faca2093e45cd1f |
|
BLAKE2b-256 | 132b4fbfc5cfd23d22fe7a44102b1e02e89264bee44fbe8a9eea3303b8ce7cb3 |