middlestorm
Introduction
Storm is a fast, small and powerful object-relational mapper. Try it to use in web-aware applications.
WSGI application mainly miltithreaded, but Store object is not thread safe.
Middlestorm middleware manage Store objects (one per thread) and add it into environ dictonary.
Simple example
- There are 3 ways to create middleware:
class
decorator
Paste configuration
Class middleware:
from wsgiref.simple_server import make_server
from storm.database import create_database
from middlestorm import MiddleStorm
def storm_app(environ, start_response):
store = environ['storm.store']
# ...
db = create_database('postgres://user:password@host/base')
app = MiddleStorm(storm_app, db)
make_server('', 8000, app).serve_forever()
Decorator middleware:
from wsgiref.simple_server import make_server
from storm.database import create_database
import middlestorm
@middlestorm.decorator(create_database('postgres://user:password@host/base'))
def storm_app(environ, start_response):
store = environ['storm.store']
# ...
make_server('', 8000, storm_app).serve_forever()
To create middleware via Paste configuration, add a stanza to the .ini file:
[filter:middlestorm] use = middlestorm#middlestorm db_uri = sqlite:myapp.db
and then add that filter to the Paste pipeline (again, in the .ini file):
[pipeline:main]
pipeline =
middlestorm
myapp
By default Store placed in variable storm.store. This can be customized:
app = MiddleStorm(storm_app, db, key='custom.mystore')
or decorator style:
@middlestorm.decorator(db, key='custom.mystore')
def storm_app(environ, start_response):
store = environ['custom.mystore']
or in the Paste configuration:
[filter:middlestorm] use = middlestorm#middlestorm db_uri = sqlite:myapp.db key = myapp.store
Legal
middlestorm distributed under terms of GNU LGPL v.2.1.
Copyright 2007 - present Vsevolod Balashov.
Links
Source code of middlestorm. Arch Linux PKGBUILD.
Metadata
Release files for middlestorm 0.8.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| middlestorm-0.8.1.tar.gz | 4.7 kB | Without provenance | Details for middlestorm-0.8.1.tar.gz |
Release files / middlestorm-0.8.1.tar.gz
| Download URL | middlestorm-0.8.1.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
02b8478cf848168eb3de6a9522176b0575b583476dfce572d00f6b66648be6d7
|
|
BLAKE2b-256 checksum How to use checksums |
3e78dc8b4840b14b0ebe6eb6b65f54730bf585d99ecace0c60b44f4ca19f5610
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for middlestorm 0.8.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.