1
0
mirror of https://github.com/pypiserver/pypiserver synced 2025-02-22 19:19:37 +01:00

provide a way to get the WSGI app

we need this for issue #3

The following now already works:

,----
| gunicorn -w4 'pypiserver:app("/home/ralf/packages")'
`----
This commit is contained in:
Ralf Schmitt 2012-03-26 01:48:08 +02:00
parent f045d8f17a
commit 5d7ecc5801

@ -1,2 +1,19 @@
__version_info__ = (0, 5, 1)
version = __version__ = "0.5.1"
def app(root=None,
redirect_to_fallback=True,
fallback_url="http://pypi.python.org/simple"):
import os
from pypiserver import core
import bottle
if root is None:
root = os.path.expanduser("~/packages")
os.listdir(root)
core.packages = core.pkgset(root)
core.config.redirect_to_fallback = redirect_to_fallback
core.config.fallback_url = fallback_url
bottle.debug(True)
return bottle.default_app()