{ "info": { "author": "\u00c9ttore Leandro Tognoli", "author_email": "ettore.leandro.tognoli@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Framework :: Django", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "Django + PyCDI\n==============\n\n.. image:: https://travis-ci.org/ettoreleandrotognoli/django-pycdi.svg?branch=master\n :target: https://travis-ci.org/ettoreleandrotognoli/django-pycdi\n\n.. image:: https://codecov.io/gh/ettoreleandrotognoli/django-pycdi/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/ettoreleandrotognoli/django-pycdi\n\n.. image:: https://badge.fury.io/py/django-pycdi.svg\n :target: https://badge.fury.io/py/django-pycdi\n\n.. image:: https://img.shields.io/pypi/dm/django-pycdi.svg\n :target: https://pypi.python.org/pypi/django-pycdi#downloads\n\nA middleware to integrate PyCDI_ with Django_.\n\nSee the `code of conduct `_.\n\n\nInstall\n-------\n\nInstall pypi version\n\n.. code-block :: shell\n\n pip install django_pycdi\n\nInstall lastest version\n\n.. code-block :: shell\n\n pip install git+https://github.com/ettoreleandrotognoli/django-pycdi.git\n \n\nUsage\n-----\n\nAdd middleware to settings.py:\n\n.. code-block :: python\n \n MIDDLEWARE += ['django_pycdi.middlewares.CDIMiddleware']\n\n\n\nAdd inject decorator to your views:\n\nWith **Python 2**:\n\n.. code-block :: python\n\n from random import random\n from django.http import HttpResponse\n from pycdi import Inject, Producer\n from pycdi.utils import Singleton\n \n \n @Singleton()\n class MySingleton():\n pass\n \n @Producer(float)\n def get_a_float():\n return random()\n\n @Inject(singleton=MySingleton,number=float)\n def view(request,singleton,number):\n return HttpResponse('...')\n \nIn the demo3 folder has a django demo project using python2 with more examples.\n\n\nWith **Python 3**:\n\n.. code-block :: python\n\n from random import random\n from django.http import HttpResponse\n from pycdi import Inject, Producer\n from pycdi.utils import Singleton\n \n @Singleton()\n class MySingleton():\n pass\n \n @Producer()\n def get_a_float() -> float:\n return random()\n \n @Inject()\n def view(request,singleton:MySingleton,number:float):\n return HttpResponse('...')\n \nIn the demo3 folder has a django demo project using python3 with more examples.\n\nSee more ways to use PyCDI_ in its page.\n\n.. _PyCDI: https://github.com/ettoreleandrotognoli/python-cdi\n\n.. _Django: https://github.com/django/django", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/ettoreleandrotognoli/django-pycdi/tree/0.1.0/", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ettoreleandrotognoli/django-pycdi", "keywords": "django,pycdi,cdi,di,code dependency injection,dependency injection", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "django-pycdi", "package_url": "https://pypi.org/project/django-pycdi/", "platform": "", "project_url": "https://pypi.org/project/django-pycdi/", "project_urls": { "Download": "https://github.com/ettoreleandrotognoli/django-pycdi/tree/0.1.0/", "Homepage": "https://github.com/ettoreleandrotognoli/django-pycdi" }, "release_url": "https://pypi.org/project/django-pycdi/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "DJango with Code Dependency Injection using PyCDI", "version": "0.1.0" }, "last_serial": 3800762, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "925f8fe481b3c83a8fdc6a069ee1198e", "sha256": "9b6901b171a25ee3ab68789c05b415f1e1fbc86b9ffbb677d6cbf39337423d5d" }, "downloads": -1, "filename": "django-pycdi-0.0.0.tar.gz", "has_sig": false, "md5_digest": "925f8fe481b3c83a8fdc6a069ee1198e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2533, "upload_time": "2017-02-03T21:04:46", "url": "https://files.pythonhosted.org/packages/8f/ba/da58419b41d53504f07caa71bf27c73dfbb45d49393e6fce5c51c2b1f1ea/django-pycdi-0.0.0.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "d462b16fb2473c7df8d69225323f844a", "sha256": "66268ea803420b542e6dd68029505a180bf4cb531e511a88d58d874fed5fac33" }, "downloads": -1, "filename": "django-pycdi-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d462b16fb2473c7df8d69225323f844a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2764, "upload_time": "2018-04-23T22:47:13", "url": "https://files.pythonhosted.org/packages/6e/23/d5e883d13f9175844999c541b2d3367a08e3a2a2ac31ab02c454780c2843/django-pycdi-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d462b16fb2473c7df8d69225323f844a", "sha256": "66268ea803420b542e6dd68029505a180bf4cb531e511a88d58d874fed5fac33" }, "downloads": -1, "filename": "django-pycdi-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d462b16fb2473c7df8d69225323f844a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2764, "upload_time": "2018-04-23T22:47:13", "url": "https://files.pythonhosted.org/packages/6e/23/d5e883d13f9175844999c541b2d3367a08e3a2a2ac31ab02c454780c2843/django-pycdi-0.1.0.tar.gz" } ] }