{"id":22923999,"url":"https://github.com/tobi-de/litestar-browser-reload","last_synced_at":"2025-10-04T21:37:46.641Z","repository":{"id":243664854,"uuid":"812998567","full_name":"Tobi-De/litestar-browser-reload","owner":"Tobi-De","description":"Automatic browser reload plugin for Litestar, designed for development use.","archived":false,"fork":false,"pushed_at":"2024-12-21T19:06:53.000Z","size":38,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-18T13:19:14.730Z","etag":null,"topics":["litestar","litestar-framework"],"latest_commit_sha":null,"homepage":"https://github.com/Tobi-De/litestar-browser-reload","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tobi-De.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-10T10:06:19.000Z","updated_at":"2024-12-21T19:06:56.000Z","dependencies_parsed_at":"2024-06-12T09:17:46.892Z","dependency_job_id":null,"html_url":"https://github.com/Tobi-De/litestar-browser-reload","commit_stats":null,"previous_names":["tobi-de/litestar-browser-reload"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tobi-De%2Flitestar-browser-reload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tobi-De%2Flitestar-browser-reload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tobi-De%2Flitestar-browser-reload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tobi-De%2Flitestar-browser-reload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tobi-De","download_url":"https://codeload.github.com/Tobi-De/litestar-browser-reload/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253837469,"owners_count":21971984,"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":["litestar","litestar-framework"],"created_at":"2024-12-14T08:19:00.376Z","updated_at":"2025-10-04T21:37:41.600Z","avatar_url":"https://github.com/Tobi-De.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# litestar-browser-reload\n\n[![PyPI - Version](https://img.shields.io/pypi/v/litestar-browser-reload.svg)](https://pypi.org/project/litestar-browser-reload)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/litestar-browser-reload.svg)](https://pypi.org/project/litestar-browser-reload)\n\n-----\n\n\u003e [!IMPORTANT]\n\u003e This plugin currently contains minimal features and is a work-in-progress\n\nAutomatic browser reload plugin for Litestar, designed for development use.\n\n## Table of Contents\n\n- [litestar-browser-reload](#litestar-browser-reload)\n  - [Table of Contents](#table-of-contents)\n  - [Installation](#installation)\n  - [Usage](#usage)\n  - [License](#license)\n  - [Credits](#credits)\n\n## Installation\n\n```console\npip install litestar-browser-reload\n```\n\n## Usage\n\nParameters of `BrowserReloadPlugin`:\n\n- `watch_paths: Sequence[Union[str, Path]]`: Paths to watch for changes.\n- `watch_filter: BaseFilter | None = None`: A [filter](https://watchfiles.helpmanual.io/api/filters/) to exclude certain directories or patterns.\n\n```python\nfrom pathlib import Path\n\nfrom litestar import Litestar\nfrom litestar.contrib.jinja import JinjaTemplateEngine\nfrom litestar.template.config import TemplateConfig\nfrom litestar_browser_reload import BrowserReloadPlugin\nfrom watchfiles import DefaultFilter\n\ntemplates_path = Path(\"templates\")\nbrowser_reload = BrowserReloadPlugin(\n    watch_paths=(Path(\"templates\"),),\n    watch_filter=DefaultFilter(ignore_dirs=(\".git\", \".hg\", \".svn\", \".tox\")),\n)\n\napp = Litestar(\n    route_handlers=[],\n    debug=True,\n    plugins=[browser_reload],\n    template_config=TemplateConfig(\n        directory=templates_path,\n        engine=JinjaTemplateEngine,\n    ),\n)\n\n```\n\nAdd the following to your base template:\n\n```html\n\u003chead\u003e\n    ...\n    {% if request.app.debug %}\n    \u003cscript\n        src=\"/__reload__/static/reload-listener.js\"\n        data-worker-script-path=\"/__reload__/static/reload-worker.js\"\n        data-ws-path=\"/__reload__\"\n        defer\n    \u003e\u003c/script\u003e\n    {% endif %}\n \u003c/head\u003e\n```\n\n## License\n\n`litestar-browser-reload` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.\n\n\n## Credits\n\nMuch of this was copied from [django-browser-reload](https://github.com/adamchainz/django-browser-reload) and [foxglove](https://github.com/samuelcolvin/foxglove)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobi-de%2Flitestar-browser-reload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobi-de%2Flitestar-browser-reload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobi-de%2Flitestar-browser-reload/lists"}