A MongoDB-to-Web gateway based on the Pyramid web framework
Project description
zopyx_gridfs
This is a tiny GridFS (MongoDB) to web gateway based on the Pyramid web framework.
Installation
requires Python 2.6
create a virtualized environment using virtualenv
inside the virtualenv environment:
bin/easy_install zopyx_gridfs
Create a server.ini configuration file containing:
[app:zopyx_gridfs] use = egg:zopyx_gridfs reload_templates = true debug_authorization = false debug_notfound = false debug_routematch = false debug_templates = true default_locale_name = en # MongoDB specific configurations mongo_host = localhost mongo_port = 27017 database = test [pipeline:main] pipeline = egg:WebError#evalerror zopyx_gridfs [server:main] use = egg:Paste#http host = 0.0.0.0 port = 6543 # Begin logging configuration [loggers] keys = root [handlers] keys = console [formatters] keys = generic [logger_root] level = INFO handlers = console [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
Start the GridFS server using (this will start a HTTP server on localhost:6543):
bin/paster serve server.ini
Usage:
Downloading files
You can access files stored inside GridFS through HTTP:
http://localhost:6543/<collection>/<filename>
where collection refers to collection used by GridFS and filename is the _id used to store the file inside GridFS.
The server will return a 404 response if the requested file could not be found.
Uploading files
For uploading files into a collection you need to use the build-in upload form:
http://localhost:6543/<collection>/upload_form
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
File details
Details for the file zopyx_gridfs-0.3.0.tar.gz
.
File metadata
- Download URL: zopyx_gridfs-0.3.0.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 752d1b57a23897ae7fda21d2360816d5d05554dc6c15dda855842111a9ff8d66 |
|
MD5 | c8da5745b7764c1e95034d920358f6f6 |
|
BLAKE2b-256 | 768eb7685d1902b9e400068b3e1ca46bb9f4ac0f148b575f6ad0b9a41add6d87 |