My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Wiki pages
Links

A Python web server designed for embedding. If you need a lightweight WSGI compatible web server to be embeded in your project, this might be a good choice.

It based on Pion-Net project which uses admirable C++ Boost Asio framework as backend HTTP server implementation.

PyCaduceus is based on Pion-Net project and WSGI glue code written by ajp-wsgi project.

Getting Started

Install

The simplest way is to download compiled binaries and copy .pyd (for windows) or .so (for linux) to your python site-packages.

You can compile by yourself using our project files (Visual Studio for Windows, Eclipse project or makefile for Linux).

Example (integration with Django)

It is easy to start PyCaduceus embedding WSGI server:

import sys
import os

sys.path.insert(0, os.path.join(path, "app"))

os.environ["DJANGO_SETTINGS_MODULE"] = "settings"

from django.core.handlers.wsgi import WSGIHandler
app = WSGIHandler()

import atexit
import PyCaduceus

server = PyCaduceus.CreateWebServer(app, "/", 8009)
server.setServiceOption('/', 'info', '1')

# Serving static files.
import settings
server.loadService('/static', 'FileService')
server.setServiceOption('/static', 'directory', settings.MEDIA_ROOT)

atexit.register(server.stop)
server.start()

while True:
    time.sleep(5)
Powered by Google Project Hosting