PKG-INFO 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. Metadata-Version: 1.1
  2. Name: django-crequest
  3. Version: 2018.5.11
  4. Summary: Middleware that makes the current request available from anywhere.
  5. Home-page: https://github.com/Alir3z4/django-crequest
  6. Author: Alireza Savand
  7. Author-email: alireza.savand@gmail.com
  8. License: Copyright (c) 2012-2018 Alireza Savand
  9. All rights reserved.
  10. Redistribution and use in source and binary forms, with or without
  11. modification, are permitted provided that the following conditions are met:
  12. * Redistributions of source code must retain the above copyright
  13. notice, this list of conditions and the following disclaimer.
  14. * Redistributions in binary form must reproduce the above copyright
  15. notice, this list of conditions and the following disclaimer in the
  16. documentation and/or other materials provided with the distribution.
  17. * Neither the name of the authors nor the
  18. names of its contributors may be used to endorse or promote products
  19. derived from this software without specific prior written permission.
  20. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  21. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  22. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  23. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
  24. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  25. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  26. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  27. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  28. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  29. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. Description-Content-Type: UNKNOWN
  31. Description: ===============
  32. django-crequest
  33. ===============
  34. .. contents::
  35. Overview
  36. ========
  37. - ``crequest`` takes care of current ``request`` in silent way.
  38. - ``crequest`` will bring you current ``request`` object of your Django application from anywhere in your code.
  39. Installing
  40. ==========
  41. ``django-crequest`` is available on http://pypi.python.org/pypi/django-crequest
  42. So it can be installed it by pip::
  43. $ python pip install django-crequest
  44. Or you can grab the latest version tarball and ::
  45. $ python setup.py install
  46. To enable ``django-crequest`` in your project
  47. * Add ``crequest`` to *INSTALLED_APPS* in your **settings.py**
  48. * Add ``crequest.middleware.CrequestMiddleware`` to ``MIDDLEWARE_CLASSES`` after the authentication and session middleware.
  49. Supported Python versions
  50. =========================
  51. ``django-crequest`` currently can be run on multiple python versions:
  52. * Python 2
  53. * Python 3
  54. * PyPy
  55. How to use
  56. ==========
  57. First import the crequest's middleware::
  58. from crequest.middleware import CrequestMiddleware
  59. Get the current ``request`` ;)::
  60. current_request = CrequestMiddleware.get_request()
  61. Done.
  62. In depth & Complex details
  63. ==========================
  64. Set the current request in UnKnown situations::
  65. CrequestMiddleware.set_request(request)
  66. Return *iam_request* if there is no current request::
  67. CrequestMiddleware.get_request(iam_request)
  68. And finally delete::
  69. CrequestMiddleware.del_request()
  70. The middleware automatically sets/deletes the current request for HTTP requests.
  71. For other uses (management commands, scripts), you will need to do this yourself.
  72. Keywords: django,request,web
  73. Platform: OS Independent
  74. Classifier: Development Status :: 5 - Production/Stable
  75. Classifier: Development Status :: 6 - Mature
  76. Classifier: Environment :: Web Environment
  77. Classifier: Framework :: Django
  78. Classifier: Intended Audience :: Developers
  79. Classifier: License :: OSI Approved :: BSD License
  80. Classifier: Operating System :: OS Independent
  81. Classifier: Programming Language :: Python
  82. Classifier: Programming Language :: Python :: 2
  83. Classifier: Programming Language :: Python :: 2.7
  84. Classifier: Programming Language :: Python :: 3
  85. Classifier: Programming Language :: Python :: 3.0
  86. Classifier: Programming Language :: Python :: 3.1
  87. Classifier: Programming Language :: Python :: 3.2
  88. Classifier: Programming Language :: Python :: 3.3
  89. Classifier: Programming Language :: Python :: 3.4
  90. Classifier: Topic :: Software Development
  91. Classifier: Topic :: Software Development :: Libraries
  92. Provides: crequest