Need help with python-varnish?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

justquick
131 Stars 40 Forks BSD 3-Clause "New" or "Revised" License 36 Commits 9 Opened issues

Description

Simple Python interface for the Varnish management port

Services available

!
?

Need anything else?

Contributors list

# 15,654
Python
sentry
Django
nacl
18 commits
# 380,115
varnish
HTML
Shell
JavaScr...
1 commit
# 690,222
Python
1 commit
# 278,341
JavaScr...
HTML
Shell
HTTP
1 commit
# 193,144
molecul...
Ansible
HTML
Django
1 commit
# 5,376
Python
newsapi
CSS
stylesh...
1 commit
# 108,514
Python
magento
local-d...
Laravel
1 commit
# 378,909
Python
1 commit

Simple Python interface for the Varnish management port

:Author: Justin Quick [email protected], Sandy Walsh [email protected] :Version: 0.2

::

pip install python-varnish==0.2.1

If you are running a version of varnish older than 3.0 then install python-varnish==0.1.2 instead.

Varnish is a state-of-the-art, high-performance HTTP accelerator. For more information checkout

Varnish Site 
_

Varnish provides a simple telnet management interface for doing things like:

  • reloading configurations
  • purging URLs from cache
  • view statistics
  • start and stop the server

This Python API takes full advantage of the available commands and can run across multiple Varnish instances. Here are the features of this python module (compared to

python-varnishadm 
_)
  • Uses
    telnetlib
    instead of raw sockets
  • Implements
    threading
    module
  • Can run commands across multiple Varnish instances
  • More comprehensive methods, closely matching the management API (
    purge_*
    ,
    vcl_*
    , etc.)
  • Unittests

Example::

manager = VarnishManager( ('server1:6082', 'server2:6082') ) manager.run('ping') manager.run('ban.url', '^/secret/$') manager.run('ban.list') manager.run('purge.url', 'http://mydomain.com/articles/.*') manager.close()

Testing::

python runtests.py

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.