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)

About

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.

Motivation

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 .

Contents

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 http://docs.webob.org/en/latest/file-example.html though the example there is more complete. I will work on making this more thorough going forward. 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.

Other Projects

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


Jeff Hammel

http://k0s.org/hg/FileServer

Project details


Download files

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

Source Distribution

FileServer-0.2.1.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file FileServer-0.2.1.tar.gz.

File metadata

  • Download URL: FileServer-0.2.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for FileServer-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0074c2c1688b22a71f220562969ddaa556aa4b8787b7bf1f12ac822708bfb4e4
MD5 7d8386335dc40edfc2b19bab9370c4a4
BLAKE2b-256 37acf05080ab423b22d65aec468de0b58f53545d65db33bbeab1cb3571a3d89f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page