{"id":19189490,"url":"https://github.com/nkvoll/djkeeper","last_synced_at":"2025-05-08T03:08:38.795Z","repository":{"id":2453179,"uuid":"3424417","full_name":"nkvoll/djkeeper","owner":"nkvoll","description":"Utilities for using ZooKeeper from a Django project.","archived":false,"fork":false,"pushed_at":"2012-09-07T14:38:12.000Z","size":93,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-08T03:08:33.786Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nkvoll.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-12T20:22:40.000Z","updated_at":"2024-10-20T09:20:17.000Z","dependencies_parsed_at":"2022-09-06T05:31:31.491Z","dependency_job_id":null,"html_url":"https://github.com/nkvoll/djkeeper","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkvoll%2Fdjkeeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkvoll%2Fdjkeeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkvoll%2Fdjkeeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkvoll%2Fdjkeeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nkvoll","download_url":"https://codeload.github.com/nkvoll/djkeeper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252989951,"owners_count":21836667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T11:29:36.202Z","updated_at":"2025-05-08T03:08:38.771Z","avatar_url":"https://github.com/nkvoll.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# djkeeper: Utilities for using ZooKeeper in a Django project\n\n# No longer maintained, supersceded by Kazoo: https://github.com/python-zk/kazoo\n\n## Installing\n\nEither install the latest relase from PYPI:\n\n    $ pip install djkeeper\n\n... or get the latest development version from GitHub:\n\n    $ pip install https://github.com/nkvoll/djkeeper/zipball/master#egg=djkeeper\n\nAdditionally, djkeeper requires a working installation of the official low level Python ZooKeeper bindings. These can either be built from source (recommended, explanation below), or\nyou could install the statically compiled version [zc-zookeeper-static](http://pypi.python.org/pypi/zc-zookeeper-static)) from PYPI, which may or may not work on your architecture/OS, and may\nor may not be the latest available ZooKeeper version.\n\n\n### Installing ZooKeeper on OS X (homebrew)\n\nIf you don't have homebrew, follow the Linux installation below, skipping \"ldconfig\", otherwise, use homebrew to install zookeeper with the ``--python`` flag:\n\n    $ brew install --python zookeeper\n\n\n### Installing ZooKeeper on Linux\n\nDownload and unpack the latest release of ZooKeeper from http://zookeeper.apache.org/releases.html:\n\n    $ tar -zxvf zookeeper-3.4.2.tar.gz\n\nBuild the C bindings:\n\n    $ cd zookeeper-3.4.2/src/c\n    $ ./configure --prefix=/usr/local\n    $ make\n    $ sudo make install\n    $ ldconfig\n\nBuild and install the python bindings:\n\n    $ cd ../contrib/zkpython\n    $ ant install\n\n\n## Running the test-suite\n\nThe test suite assumes you have a ZooKeeper server running on localhost:22181:\n\n    $ cd example\n    $ export ZOOCFGDIR=$(pwd) zkServer start-foreground\n\nzkServer / zkServer.sh is found in the ZooKeeper installation directory.\n\nThe tests can then be run via the setup.py script:\n\n    $ python setup.py test\n\n\n## Example usage with Django\n\nSee https://github.com/nkvoll/pykeeper/blob/master/Readme.md for more detailed usage of the client object instance.\n\n### Configuring:\n\nZooKeeper clients are configured in your ``settings.py`` file under the configuration key ``DJKEEPER``:\n\n    DJKEEPER = dict(\n        clients = dict(\n            client_name = dict(\n                servers = 'localhost:22181', # defaults to localhost:2181\n                reconnect = True # defaults to True, which means the client should reconnect if the connection is lost\n            )\n        )\n    )\n\nMultiple named clients can be configured this way.\n\n### Using in a view:\n\nFor example, in ``views.py``:\n\n    from django.http import HttpResponse\n    from djkeeper import manager\n\n\n    def index(request):\n        client = manager.ZooKeeperManager.get_or_create_client('client_name')\n        root_children = client.get_children('/')\n        return HttpResponse('Root children: {0}'.format(root_children))\n\n\n``manager.ZooKeeperManager`` accepts the following keyword parameters:\n\n    * ``auto_connect``: Whether to call .connect() on a newly created client before returning it. Defaults to true.\n    * ``wait_until_connected``: Whether to block until the client state becomes ``connected`` before returning the client. Defaults to true.\n    * ``wait_until_connected_timeout``: How long the call is allowed to block (in seconds) before a ``pykeeper.TimeoutException`` is raised. Defaults to ``None``, which means no timeout.\n\n\n### Admin-overview\n\nFirst, add ``djkeeper`` to your list of ``INSTALLED_APPS`` in settings.py, then\nadd the following route to your urls.py:\n\n    #...\n    url(r'^admin/djkeeper/', 'djkeeper.views.index'),\n    #...\n\nOr, if you use [django-adminplus](https://github.com/jsocol/django-adminplus), an overview over the clients is automatically\nadded to the admin panel when you call ``admin.autodiscover()``. In this case, the custom route should NOT be added to your urls.py.\n\n\n## License\n\nMIT licensed, see LICENSE for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkvoll%2Fdjkeeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnkvoll%2Fdjkeeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkvoll%2Fdjkeeper/lists"}