Metadata-Version: 1.1
Name: django-commandlog
Version: 0.1.7
Summary: A Django app to log management commands
Home-page: https://github.com/achedeuzot/django-commandlog
Author: Klemen Sever
Author-email: klemen@achedeuzot.me
License: BSD License
Download-URL: https://github.com/achedeuzot/django-commandlog/tarball/0.1.7
Description: ==========================================
        Django CommandLog - Django Command logging
        ==========================================
        
        .. image:: https://travis-ci.org/achedeuzot/django-commandlog.svg?branch=master
            :target: https://travis-ci.org/achedeuzot/django-commandlog?branch=master
        
        .. image:: https://coveralls.io/repos/github/achedeuzot/django-commandlog/badge.svg?branch=master
            :target: https://coveralls.io/github/achedeuzot/django-commandlog?branch=master
        
        Django CommandLog adds the feature of logging the django management commands into the database so it's available in the admin interface.
        
        We've been using this to check the result of scheduled management commands directly through the admin interface. It works by copying the stream of ``stdout`` and ``stderr``.
        
        The decorator also adds some helper methods, see below.
        
        Quick start
        -----------
        
        1. Add "django_commandlog" to your ``INSTALLED_APPS`` settings like this:
        
        .. code-block:: python
        
            INSTALLED_APPS = [
                ...
                'django_commandlog',
            ]
        
        
        2. Run `python manage.py migrate` to add the tables of `django_commandlog` to your database.
        
        3. To log an admin command, add the `@command_log` decorator above the class
        (see example below). Thus, it currently supports only custom management
        commands. If you wish to add this to default django manage commands you'll
        have to create a child class with the decorator. Pull/Merge requests
        are welcome with a fix for this.
        
        .. code-block:: python
        
            @command_log
            class SampleCommand(BaseCommand):
        
                def handle(self, *args, **options):
                    ...
        
        Configuration
        -------------
        
        There are currently no configuration values.
        
        Helper methods
        --------------
        When your class is decorated with ``@command_log``, you have access to additional methods.
        
        CommandLog includes counters for basic CRUD operations (Create, Read, Update, Delete) which can be used
        through helper methods provided:
        
        .. code-block:: python
        
            add_log_created(10)
            add_log_read(30)
            add_log_updated(20)
            add_log_deleted(30)
            add_log_errors(14)
        
        There are two fields used to track the commands or runs: reference and user.
        Reference is any number you want to track in your manage commands.
        
        You can also add a user to the tracking by using the `add_log_user(user)` method. `user` can be a string which will be kept as-is or you can use a `settings.AUTH_USER_MODEL` object.
        
        .. code-block:: python
        
            add_log_reference("C1235342321")
            add_log_user("user:ldap:username")
            # or
            add_log_user(user_instance)
        
        Requirements
        ------------
        
        - python 2.7, 3.4, 3.5
        - django 1.10
        
        
        Tested on `Django`_ 1.10.3
        
        .. _Django: http://www.djangoproject.com/
        
        
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
