Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Mount your Flask or WSGI app in your Django app.

Project description


Trappist is a Python library which allows you to mount your Flask or other WSGI application inside of your Django application. It translates a call to a “Django view” to a call to a WSGI, and handles the translation of the Flask app response back as a Django HttpResponse object.


Trappist is hosted on Pypi, so a simple pip install trappist or easy_install trappist should do the trick.


To use Trappist, simply construct a new Trappist object to wrap your existing WSGI application, and call mounted_at('/path') to mount the app at that location. For example, here is a “blog” WSGI app mounted at ‘/blog’ inside an existing Django application:

from django.conf.urls.defaults import patterns, include, url
from my_blog import app
from trappist import Trappist

urlpatterns = patterns('',
    (r'^articles/(?P<year>\d{4})/$', 'news.views.year_archive'),
    (r'^comments/', include('django.contrib.comments.urls'))

The root of the blog application would then be accessible at /blog, relative to the Django application root.

Note: The mountpoint passed to mounted_at must be a string with a leading forward slash (/). Any other form of mountpoint prefix is not supported.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for trappist, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size trappist-0.2.0.tar.gz (2.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page