Skip to main content

pypiweb description

Project description

It’s a fork of pypi-server (

Add a interface pypi web: http//<my-ip>/pypi and add manage template

For install, use: and replace pypi-server command by pypiweb


pip install pypiweb


git clone
cd pypiweb
python install

Uploading packages from sources, remotely

Instead of copying packages directly to the server’s folder, you may also upload them remotely with a python upload command. Currently only password-protected uploads are supported!

  1. First make sure you have the passlib module installed, which is needed for parsing the apache htpasswd file specified by the -P, –passwords option (see next steps):

    pip install passlib
  2. Create the apache htpasswd file with at least one user/password pair with this command (you’ll be prompted for a password):

    htpasswd -sc .htaccess <some_username>


    Read this SO question for running htpasswd cmd under Windows:

    or if you have bogus passwords for an internal service you may use this public service:

    It is also possible to disable authentication even for uploads. To avoid lazy security decisions, read help for -P and -a options.

  3. You need to restart the server with the -P option only once (but user/password pairs can later be added or updated on the fly):

    ./pypiweb -p 8080 -P .htaccess ~/packages &
  4. You need change a template:

    ./pypiweb -p 8080 -P .htaccess --add-template mytemplatedir ~/packages &
  5. On client-side, edit or create a ~/.pypirc file with a similar content:

    index-servers =
    repository: http://localhost:8080
    username: <some_username>
    password: <some_passwd>
  6. Then from within the directory of the python-project you wish to upload, issue this command:

    python sdist upload -r local


To avoid storing you passwords on disk in clear text, you may either:
  • Use the register command with the -r option, like that:

    python sdist register -r local upload -r local
  • Use twine library which breaks the procedure in two steps.

Client-side configurations

Always specifying the the pypi url on the command line is a bit cumbersome. Since pypiweb redirects pip/easy_install to the index if it doesn’t have a requested package, it’s a good idea to configure them to always use your local pypi index.


For pip this can be done by setting the environment variable PIP_EXTRA_INDEX_URL in your .bashrc/.profile/.zshrc:

export PIP_EXTRA_INDEX_URL=http://localhost:8080/simple/

or by adding the following lines to ~/.pip/pip.conf:

extra-index-url = http://localhost:8080/simple/


If you have installed pypiweb on a remote url without https you wil receive an “untrusted” warning from pip, urging you to append the –trusted-host option. You can also include this option permanently in your configuration-files or environment variables.

Using a different WSGI server

  • pypiweb ships with it’s own copy of bottle. It’s possible to use bottle with different WSGI servers.

  • pypiweb chooses any of the following paste, cherrypy, twisted, wsgiref (part of python) if available.

  • If none of the above servers matches your needs, pypiserver also exposes an API to get the internal WSGI app, which you can then run under any WSGI server you like. has the following interface:

    def app(root=None,

    and returns the WSGI application. root is the package directory, redirect_to_fallback specifies whether to redirect to fallback_url when a package is missing.


In case you’re using apache2 with mod_wsgi, the following config-file (contributed by Thomas Waldmann) can be used:

# An example pypiserver.wsgi for use with apache2 and mod_wsgi, edit as necessary.
# apache virtualhost configuration for mod_wsgi daemon mode:
#    Alias /robots.txt /srv/yoursite/htdocs/robots.txt
#    WSGIPassAuthorization On
#    WSGIScriptAlias /     /srv/yoursite/cfg/pypiserver.wsgi
#    WSGIDaemonProcess     pypisrv user=pypisrv group=pypisrv processes=1 threads=5 maximum-requests=500 umask=0007 display-name=wsgi-pypisrv inactivity-timeout=300
#    WSGIProcessGroup      pypisrv

PACKAGES = "/srv/yoursite/packages"
HTPASSWD = "/srv/yoursite/htpasswd"
TEMPLATE = "/srv/yoursite/template"
import pypiweb
application =, redirect_to_fallback=True, password_file=HTPASSWD, add_template=TEMPLATE)


For change logo for simple, create a directory template/static/images/ and add a file python-logo.png with your logo.

For list of template:

  • packages.tpl for url http//<my-ip>/packages
  • pypiindex.tpl for url http//<my-ip>/pypi/
  • pypipkg.tpl for url http//<my-ip>/pypi/pkg
  • simple for url http//<my-ip>/simple
  • simpleprefix.tpl for url http//<my-ip>/simple/prefix
  • welcome.tpl for url http//<my-ip>/
  • static/… for url http//<my-ip>/static/…

Download files

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

Source Distribution

pypiweb-0.1.1.tar.gz (68.2 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page