Skip to main content

a simple static fileserver and directory index server in python (WSGI app)

Project description

a simple static fileserver and directory index server in python (WSGI app)


Often for testing you will want a static fileserver and directory index as part of your WSGI stack. In addition, you may have requirements to run such as part of a production WSGI stack. FileServer fits these needs.


I needed a directory index server a la Apache to test a PyPI clone I was using. After surveying what was out there, there didn’t seem anything out there that was easily consumable for my purposes. So I wrote one only depending on webob .


from fileserver import * should give you access to all of the usable components of fileserver:

  • file_response: return a webob response object appropriate to a file name
  • FileApp: WSGI app that wraps file_response
  • Directory Server: serves a directory tree and generated indices
  • main: command line entry point

FileApp and file_response are heavily borrowed from . I also borrowed from Paste’s StaticURLParser and static.Cling.

In addition there is a command line script, serve, which may be used to serve a directory with the wsgiref server.


doctests and a test runner,, exist in the tests/ subdirectory of . I currently use paste.fixture.TestApp to mock requests and inspect responses, but should probably move to WebTest .

Other Projects

While I didn’t find them suitable for my use, there are other standalone static fileservers available for python:

Jeff Hammel

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 FileServer, version 0.3
Filename, size File type Python version Upload date Hashes
Filename, size FileServer-0.3.tar.gz (4.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page