PKG-INFO 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. Metadata-Version: 1.1
  2. Name: wfastcgi
  3. Version: 3.0.0
  4. Summary: An IIS-Python bridge based on WSGI and FastCGI.
  5. Home-page: http://aka.ms/python
  6. Author: Microsoft Corporation
  7. Author-email: ptvshelp@microsoft.com
  8. License: Apache License 2.0
  9. Description: WFastCGI
  10. ========
  11. wfastcgi.py provides a bridge between `IIS <http://www.iis.net/>`__ and Python
  12. using WSGI and FastCGI, similar to what ``mod_python`` provides for Apache HTTP
  13. Server.
  14. It can be used with any Python web application or framework that supports WSGI,
  15. and provides an efficient way to handle requests and process pools through IIS.
  16. Installation
  17. ============
  18. Downloading Package
  19. -------------------
  20. To install via the Python Package Index (PyPI), type:
  21. .. code:: shell
  22. pip install wfastcgi
  23. Installing IIS and FastCGI
  24. --------------------------
  25. See the `IIS Installation <http://www.iis.net/learn/install>`__ page for
  26. information about installing IIS on your version of Windows.
  27. The Application Development/CGI package is required for use with `wfastcgi`.
  28. Enabling wfastcgi
  29. -----------------
  30. Once ``wfastcgi`` and IIS are installed, run ``wfastcgi-enable`` as an
  31. administrator to enable ``wfastcgi`` in the IIS configuration. This will
  32. configure a CGI application that can then be specified as a
  33. `route handler <#route-handlers>`__.
  34. .. code:: shell
  35. wfastcgi-enable
  36. To disable ``wfastcgi`` before uninstalling, run ``wfastcgi-disable``.
  37. .. code:: shell
  38. wfastcgi-disable
  39. pip uninstall wfastcgi
  40. **Note**: uninstalling ``wfastcgi`` does not automatically unregister the CGI
  41. application.
  42. If the first argument passed to ``wfastcgi-enable`` or ``wfastcgi-disable`` is
  43. a valid file, the entire command line is used to register or unregister the CGI
  44. handler.
  45. For example, the following command will enable wfastcgi with IIS Express and a
  46. specific host configuration:
  47. .. code:: shell
  48. wfastcgi-enable "C:\Program Files (x86)\IIS Express\appcmd.exe"
  49. /apphostconfig:C:\Path\To\applicationhost.config
  50. You can disable wfastcgi in the same configuration file using
  51. ``wfastcgi-disable`` with the same options:
  52. .. code:: shell
  53. wfastcgi-disable "C:\Program Files (x86)\IIS Express\appcmd.exe"
  54. /apphostconfig:C:\Path\To\applicationhost.config
  55. .. route-handlers
  56. Route Handlers
  57. ==============
  58. Routing requests to your Python application requires some site-local
  59. configuration. In your site's ``web.config`` file, you will need to add a
  60. handler and some app settings:
  61. .. code:: xml
  62. <configuration>
  63. <system.webServer>
  64. <handlers>
  65. <add name="Python FastCGI"
  66. path="*"
  67. verb="*"
  68. modules="FastCgiModule"
  69. scriptProcessor="C:\Python36\python.exe|C:\Python36\Lib\site-packages\wfastcgi.py"
  70. resourceType="Unspecified"
  71. requireAccess="Script" />
  72. </handlers>
  73. </system.webServer>
  74. <appSettings>
  75. <!-- Required settings -->
  76. <add key="WSGI_HANDLER" value="my_app.wsgi_app()" />
  77. <add key="PYTHONPATH" value="C:\MyApp" />
  78. <!-- Optional settings -->
  79. <add key="WSGI_LOG" value="C:\Logs\my_app.log" />
  80. <add key="WSGI_RESTART_FILE_REGEX" value=".*((\.py)|(\.config))$" />
  81. <add key="APPINSIGHTS_INSTRUMENTATIONKEY" value="__instrumentation_key__" />
  82. <add key="DJANGO_SETTINGS_MODULE" value="my_app.settings" />
  83. <add key="WSGI_PTVSD_SECRET" value="__secret_code__" />
  84. <add key="WSGI_PTVSD_ADDRESS" value="ipaddress:port" />
  85. </appSettings>
  86. </configuration>
  87. The value for ``scriptProcessor`` is displayed in the output of
  88. ``wfastcgi-enable`` and may vary from machine to machine. The values for
  89. ``path`` and ``verb`` may also be customized to further restrict the requests
  90. for which this handler will be used.
  91. The ``name`` value may be used in nested ``web.config`` files to exclude this
  92. handler. For example, adding a ``web.config`` to your ``static/`` subdirectory
  93. containing ``<remove name="Python FastCGI" />`` will prevent IIS from serving
  94. static files through your Python app.
  95. The provided app settings are translated into environment variables and can be
  96. accessed from your Python application using ``os.getenv``. The following
  97. variables are used by ``wfastcgi``.
  98. WSGI_HANDLER
  99. ------------
  100. This is a Python name that evaluates to the WSGI application object. It is a
  101. series of dotted names that are optionally called with no parameters. When
  102. resolving the handler, the following steps are used:
  103. 1. As many names as possible are loaded using ``import``. The last name is
  104. never imported.
  105. 2. Once a module has been obtained, each remaining name is retrieved as an
  106. attribute. If ``()`` follows the name, it is called before getting the
  107. following name.
  108. Errors while resolving the name are returned as a simple 500 error page.
  109. Depending on your IIS configuration, you may only receive this page when
  110. accessing the site from the same machine.
  111. PYTHONPATH
  112. ----------
  113. Python is already running when this setting is converted into an environment
  114. variable, so ``wfastcgi`` performs extra processing to expand environment
  115. variables in its value (including those added from app settings) and to expand
  116. ``sys.path``.
  117. If you are running an implementation of Python that uses a variable named
  118. something other than ``PYTHONPATH``, you should still specify this value as
  119. ``PYTHONPATH``.
  120. WSGI_LOG
  121. --------
  122. This is a full path to a writable file where logging information is written.
  123. This logging is not highly efficient, and it is recommended that this setting
  124. only be specified for debugging purposes.
  125. WSGI_RESTART_FILE_REGEX
  126. -----------------------
  127. The regular expression used to identify when changed files belong to your
  128. website. If a file belonging to your site changes, all active CGI processes
  129. will be terminated so that the new files can be loaded.
  130. By default, all ``*.py`` and ``*.config`` files are included. Specify an empty
  131. string to disable auto-restart.
  132. APPINSIGHTS_INSTRUMENTATIONKEY
  133. ------------------------------
  134. Providing an instrumentation key with this value will enable request tracing
  135. with `Application Insights <http://pypi.org/project/applicationinsights>`__
  136. for your entire site. If you have not installed the ``applicationinsights``
  137. package, a warning is written to ``WSGI_LOG`` (if enabled) but the site will
  138. operate normally.
  139. Application Insights is a low-overhead monitoring system for tracking your
  140. application's health and performance. When enabled, all errors in your site
  141. will be reported through Application Insights.
  142. DJANGO_SETTINGS_MODULE
  143. ----------------------
  144. A commonly used registry key when deploying sites built using Django. Typically
  145. Django sites will set ``WSGI_HANDLER`` to
  146. ``django.core.handlers.wsgi.WSGIHandler()`` and load app-specific settings
  147. through the module specified by this value.
  148. Sites using frameworks other than Django do not need to specify this value.
  149. WSGI_PTVSD_SECRET
  150. -----------------
  151. Providing an arbitrary string here and including the
  152. `ptvsd <https://pypi.org/project/ptvsd>`__ module in your environment will
  153. automatically enable remote debugging of your web site. The string in this
  154. application setting should be treated as a password, and needs to be provided
  155. when attaching to the running site.
  156. WSGI_PTVSD_ADDRESS
  157. ------------------
  158. When ``WSGI_PTVSD_SECRET`` is specified, this value may also be specified to
  159. override the default listening address for remote debugging. By default,
  160. your site will listen on ``localhost:5678``, but in many cases you may need
  161. to change this to ``0.0.0.0:some-port`` in order to attach remotely.
  162. Remember that you will also need to forward the port through any firewalls
  163. you might have configured.
  164. Keywords: iis fastcgi wsgi windows server mod_python
  165. Platform: UNKNOWN
  166. Classifier: Development Status :: 6 - Mature
  167. Classifier: License :: OSI Approved :: Apache Software License
  168. Classifier: Operating System :: Microsoft :: Windows
  169. Classifier: Programming Language :: Python :: 2
  170. Classifier: Programming Language :: Python :: 2.7
  171. Classifier: Programming Language :: Python :: 3
  172. Classifier: Programming Language :: Python :: 3.3
  173. Classifier: Programming Language :: Python :: 3.4
  174. Classifier: Programming Language :: Python :: 3.5
  175. Classifier: Programming Language :: Python :: 3.6
  176. Classifier: Topic :: Internet
  177. Classifier: Topic :: Internet :: WWW/HTTP
  178. Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
  179. Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Server