semvec/pypi-packages huggingface dataset:
django-promoter 1.0.1
Django commands used to promote or demote users
License: MIT
Keywords: django auth admin cli python3.5

Django Promoter
===============

|License: MIT| |PyPI version|

    Give me the damn rights.

Current Features
----------------

-  Promote an existing user
-  Demote an existing user

Installation
------------

-  

   1. Install using ``pip install django-promoter``

-  

   2. Add ``'django_promoter'`` to your ``'INSTALLED_APPS'`` settings

-  

   3. You can now access the ``promote`` and ``demote`` commands from
      your ``./manage.py``

Usage
-----

Promote a user
^^^^^^^^^^^^^^

.. code:: bash

    $ ./manage.py promote username

Demote a user
~~~~~~~~~~~~~

.. code:: bash

    $ ./manage.py demote username

Why would I use this ?
----------------------

The main purpose of this project is to be able to manage rights when you 
have to use a read-only backend.
The `./manage.py createsuperuser` isn't available because you can't create
new users.
Using Django Promoter, once the user is inserted in the Django database,
you can promote him to a superuser without having to modify the auth database.

License
-------

The MIT License (MIT)

Copyright © 2017 Numberly


.. |License: MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg
   :target: https://opensource.org/licenses/MIT
.. |PyPI version| image:: https://badge.fury.io/py/promoter.svg
   :target: https://badge.fury.io/py/django_promoter
syringe 0.4.0
A simple dependency injection library
License: MIT

=======
Syringe
=======

.. image:: https://travis-ci.org/remcohaszing/grunt-angular-templatecache.png?branch=master
   :target: https://travis-ci.org/remcohaszing/python-audiolayer

A simple dependency injection library.


Usage example
=============

First decorate a class with ``@provides('a lookup name')``.

>>> import syringe
>>>
>>> @syringe.provides('cure')
... class Syrup:
...     def drink(self, person):
...         print('Nom nom')
...         person.health = 100
...

Instantiate it. Note that it is not possible to instanciate another instance of
a class decorated with the name ``cure``.

>>> syrup = Syrup()

Next inject it in another class using ``inject('a lookup name')``.

>>> class Person:
...     cure = syringe.inject('cure')
...
...     def drink_medicine(self):
...         self.cure.drink(self)
...

When an instance of the ``Person`` class is created, the value of the injecte name
is the instance of the provided and instantiated class.

>>> person = Person()
>>> person.health = 20
>>> assert person.cure == syrup
>>> person.drink_medicine()
Nom nom
>>> assert person.health == 100


Mocking
-------

A mock instance can be inserted using ``syringe.mock('a lookup name')``

>>> try:
...     from unittest import mock
... except:
...     import mock
...
>>> m = syringe.mock('cure')
>>> person.drink_medicine()
>>> m.drink.assert_called_once_with(person)


Installing
==========

The package can be installed from the cheese shop by typing::

    pip install syringe