semvec/pypi-packages huggingface dataset:
django-siteflags 1.3.0
Reusable application for Django allowing users to flag/bookmark site objects
License: BSD 3-Clause License

django-siteflags
================
https://github.com/idlesign/django-siteflags

.. image:: https://img.shields.io/pypi/v/django-siteflags.svg
    :target: https://pypi.python.org/pypi/django-siteflags

.. image:: https://img.shields.io/pypi/l/django-siteflags.svg
    :target: https://pypi.python.org/pypi/django-siteflags

.. image:: https://img.shields.io/coveralls/idlesign/django-siteflags/master.svg
    :target: https://coveralls.io/r/idlesign/django-siteflags


Description
-----------

*Reusable application for Django allowing users to flag/bookmark site objects*

So you want a user to be able to put some flags on certain site entities.

Let's say you need a kind of bookmark powered service, or a site where content is flagged and moderated,
or a simplified rating system, or something similar.

Inherit you model from ``siteflags.models.ModelWithFlag`` and you're almost done.

Like that:

.. code-block:: python

    # myapp/models.py
    from siteflags.models import ModelWithFlag


    class Article(ModelWithFlag):

        ...  # Some model fields here.


And like so:

.. code-block:: python

    # myapp/views.py
    from django.shortcuts import get_object_or_404
    from .models import Article


    def article_details(request, article_id):

        article = get_object_or_404(Article, pk=article_id)

        user = request.user
        article.set_flag(user)
        article.is_flagged(user)
        article.remove_flag(user)
        
        ...


Quite simple. Quite generic. Read the documentation.


Documentation
-------------

http://django-siteflags.readthedocs.org/
systemd-logging 1.0.1
Simplifies logging for systemd
License: BSD 3-Clause License

systemd-logging
===============
https://github.com/idlesign/systemd-logging

|release| |lic| |coverage|

.. |release| image:: https://img.shields.io/pypi/v/systemd-logging.svg
    :target: https://pypi.python.org/pypi/systemd-logging

.. |lic| image:: https://img.shields.io/pypi/l/systemd-logging.svg
    :target: https://pypi.python.org/pypi/systemd-logging

.. |coverage| image:: https://img.shields.io/coveralls/idlesign/systemd-logging/master.svg
    :target: https://coveralls.io/r/idlesign/systemd-logging


Description
-----------

*Simplifies logging for systemd*

**Requires Python 3.6+**

* No need to compile (pure Python), uses ``libsystemd.so``.
* Simplified configuration.
* Just logging. Nothing more.


Usage
-----

.. code-block:: python

    import logging

    from systemdlogging.toolbox import init_systemd_logging

    # This one line in most cases would be enough.
    # By default it attaches systemd logging handler to a root Python logger.
    init_systemd_logging()  # Returns True if initialization went fine.

    # Now you can use logging as usual.
    logger = logging.getLogger(__name__)
    logger.setLevel(logging.DEBUG)

    logger.debug('My debug message')

    try:
        raise ValueError('Log me please')

    except ValueError:
        # Additional context can be passed in extra.context.
        logger.exception('Something terrible just happened', extra={
            'message_id': True,  # Generate message ID automatically.
            'context': {
                'FIELD1': 'one',
                'FIELD2': 'two',
            }
        }, stack_info=True)


Read the docs to find out more.


Documentation
-------------

https://systemd-logging.readthedocs.org/

Debug runs
~~~~~~~~~~

1. Run your script with:

  .. code-block::

      $ sudo systemd-run -u debugme -t /usr/bin/python /home/my/testme.py

2. Watch its journal with:

  .. code-block::

      $ journalctl -u debugme -f -o verbose