nginxpy
nginxpy copied to clipboard
Embed Python in NGINX.
======= NGINXpy
.. image:: https://img.shields.io/pypi/v/nginxpy.svg :target: https://pypi.python.org/pypi/nginxpy
.. image:: https://img.shields.io/travis/decentfox/nginxpy.svg :target: https://travis-ci.org/decentfox/nginxpy
.. image:: https://readthedocs.org/projects/nginxpy/badge/?version=latest :target: https://nginxpy.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
.. image:: https://pyup.io/repos/github/decentfox/nginxpy/shield.svg :target: https://pyup.io/repos/github/decentfox/nginxpy/ :alt: Updates
Embed Python in NGINX.
- Free software: Apache Software License 2.0
- Documentation: https://nginxpy.readthedocs.io.
Features
- Standard Python package with Cython extension
- Automatically build into NGINX dynamic module for current NGINX install
- Run embeded Python in NGINX worker processes
- Write NGINX modules in Python or Cython
- Python
logging
module redirected to NGINXerror.log
- (ongoing) NGINX event loop wrapped as Python
asyncio
interface - (TBD) Python and Cython interface to most NGINX code
- (TBD) Adapt NGINX web server to WSGI, ASGI and aiohttp interfaces
Installation
- Install NGINX in whatever way, make sure
nginx
command is available. -
pip install nginxpy
, or get the source and runpip install .
. You may want to add the-v
option, because the process is a bit slow downloading Cython, NGINX source code and configuring it. The usualpython setup.py install
currently doesn't work separately - you should runpython setup.py build
first. - Run
python -c 'import nginx'
to get NGINX configuration hint. - Update NGINX configuration accordingly and reload NGINX.
- Visit your NGINX site, see NGINX
error.log
for now.
Development
- Install NGINX in whatever way, make sure
nginx
command is available. - Checkout source code.
- Run
python setup.py build && python setup.py develop
. - Run
python -c 'import nginx'
to get NGINX configuration hint. - Update NGINX configuration accordingly and reload NGINX.
- Visit your NGINX site, see NGINX
error.log
for now. - Change code if result is not satisfying, or else go for pull request.
- Goto 3 if Cython code was changed, or else goto 5.
Surprisingly NGINX has a very simple but powerful architecture, learn about it here: http://nginx.org/en/docs/dev/development_guide.html
Credits
This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage
_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _audreyr/cookiecutter-pypackage
: https://github.com/audreyr/cookiecutter-pypackage