Registry / web-framework / mod-wsgi

mod-wsgi

JSON →
library6.0.4pypypiunverified

mod_wsgi is an Apache HTTP Server module that provides a WSGI compliant interface for hosting Python web applications under Apache. It supports both embedded and daemon modes, with the ability to run multiple Python versions and virtual environments. Current version 5.0.2 (2024-02-19) requires Python >=3.8. Release cadence is irregular, typically minor updates every few years.

pip install mod-wsgi
INSTALL
IMPORT
SIG · MOD-WSGI
M
mod-wsgi
web-frameworkpythonv6.0.4
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

application
def application(environ, start_response): ... # then assign to module-level 'application'
WSGI application callable must be named 'application' (default) or specified via WSGIApplicationGroup directive.

Minimal WSGI application file. Place in your Apache document root or a directory accessible to Apache, then configure Apache with 'WSGIScriptAlias / /path/to/myapp.wsgi'.

# Save as myapp.wsgi def application(environ, start_response): status = '200 OK' output = b'Hello, World!' response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers) return [output]
Debug
Known issues
breakingThread limit issues when using embedded mode with threaded MPM (worker/event). Default threads per process may cause crashes if exceeded.
fix
Use 'WSGIDaemonProcess' to isolate application in daemon mode with controlled thread count.
affects: all
gotchaMemory leak when using Python threads or blocking I/O inside mod_wsgi daemon mode with multiple processes.
fix
Set 'WSGIApplicationGroup %{GLOBAL}' if using single-threaded frameworks; use 'maximum-requests' to recycle processes.
affects: all
deprecatedPython 2 support removed in 5.0.0; mod_wsgi 4.x still available for Python 2.
fix
Migrate to Python 3 and upgrade mod_wsgi to >=5.0.0.
affects: >=5.0.0
deprecatedThe 'mod_wsgi-express' command is the recommended development server but is not production-ready.
fix
Use Apache with mod_wsgi in production; mod_wsgi-express is for testing only.
affects: >=4.6.0
gotchaVirtual environments: must be activated before Apache start or specify Python home via WSGIPythonHome.
fix
Set 'WSGIPythonHome /path/to/venv' in Apache config.
affects: all
Upgrade
Version history
6.0.4latest on PyPI · released Jun 14, 2026
Audit
Dependencies
apache2-devoptionalRequired to compile mod_wsgi from source (system package).
libapache2-mod-wsgi-py3optionalAlternative pre-packaged binary for Debian/Ubuntu instead of pip install.
Agent activity
4 hits · last 30 days
node
4
Resources
mod-wsgi — pip install mod-wsgi · libregistry