Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
.. contents:
Storm <https://storm.canonical.com>
_ 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 <https://storm.canonical.com/Manual#head-87f6030209535be685673b258a552728a235a594>
_.
Middlestorm middleware manage Store objects (one per thread) and add it into environ
dictonary <http://www.python.org/dev/peps/pep-0333/#environ-variables>
_.
There are 3 ways to create middleware:
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
middlestorm distributed under terms of
GNU LGPL v.2.1 <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt>
_.
Copyright 2007 - present Vsevolod Balashov <http://vsevolod.balashov.name/>
_.
Source code of middlestorm <http://bitbucket.org/sevkin/middlestorm/>
.
Arch Linux PKGBUILD <http://aur.archlinux.org/packages.php?ID=36570>
.
FAQs
Middleware for use Storm ORM in WSGI applications
We found that middlestorm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.