{"id":28520640,"url":"https://github.com/aio-libs/aiohttp-devtools","last_synced_at":"2025-07-02T19:32:35.615Z","repository":{"id":37270138,"uuid":"68917117","full_name":"aio-libs/aiohttp-devtools","owner":"aio-libs","description":"dev tools for aiohttp","archived":false,"fork":false,"pushed_at":"2025-05-05T22:50:14.000Z","size":761,"stargazers_count":258,"open_issues_count":7,"forks_count":44,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-06-09T07:08:38.519Z","etag":null,"topics":["aiohttp","asyncio","cookiecutter","developer-tools","development","devtools","reload"],"latest_commit_sha":null,"homepage":null,"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/aio-libs.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":"LICENSE","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":"2016-09-22T12:03:09.000Z","updated_at":"2025-06-03T22:57:17.000Z","dependencies_parsed_at":"2024-01-08T23:24:38.468Z","dependency_job_id":"f13798ab-dab8-4207-9b42-a916e5056011","html_url":"https://github.com/aio-libs/aiohttp-devtools","commit_stats":{"total_commits":555,"total_committers":27,"mean_commits":"20.555555555555557","dds":0.7063063063063063,"last_synced_commit":"db5424cf921ffd28fac7ac3f11909b27410a1d46"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/aio-libs/aiohttp-devtools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Faiohttp-devtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Faiohttp-devtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Faiohttp-devtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Faiohttp-devtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aio-libs","download_url":"https://codeload.github.com/aio-libs/aiohttp-devtools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Faiohttp-devtools/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263203417,"owners_count":23430025,"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":["aiohttp","asyncio","cookiecutter","developer-tools","development","devtools","reload"],"created_at":"2025-06-09T07:07:49.717Z","updated_at":"2025-07-02T19:32:35.606Z","avatar_url":"https://github.com/aio-libs.png","language":"Python","readme":"aiohttp-devtools\n================\n\n|Coverage| |pypi| |license|\n\nDev tools for `aiohttp`_.\n\n**aiohttp-devtools** provides a number of tools useful when developing applications with aiohttp and associated\nlibraries.\n\nInstallation\n------------\n\n.. code:: shell\n\n    pip install aiohttp-devtools\n\nUsage\n-----\n\nThe ``aiohttp-devtools`` CLI (and it's shorter alias ``adev``) consist of two sub-commands:\n`runserver`_ and `serve`_.\n\nrunserver\n~~~~~~~~~\n\nProvides a simple local server for running your application while you're developing.\n\nUsage is simply\n\n.. code:: shell\n\n    adev runserver \u003capp-path\u003e\n\n**Note:** ``adev runserver \u003capp-path\u003e`` will import the whole file, hence it doesn't work\nwith ``web.run_app(app)``. You can however use ``if __name__ == '__main__': web.run_app(app)``.\n\n``app-path`` can be a path to either a directory containing a recognized default file (``app.py``\nor ``main.py``) or to a specific file. The ``--app-factory`` option can be used to define which method is called\nfrom the app path file, if not supplied some default method names are tried\n(namely `app`, `app_factory`, `get_app` and `create_app`, which can be\nvariables, functions, or coroutines).\n\nAll ``runserver`` arguments can be set via environment variables.\n\n``runserver`` has a few useful features:\n\n* **livereload** will reload resources in the browser as your code changes without having to hit refresh, see `livereload`_ for more details.\n* **static files** are served separately from your main app (generally on ``8001`` while your app is on ``8000``) so you don't have to contaminate your application to serve static files you only need locally.\n\nThe ``--ssl-context-factory`` option can be used to define method from the app path file, which returns ssl.SSLContext\nfor ssl support. \nIf You are going to use self-signed certificate for your dev server, you should install proper rootCA certificate to your system.\nOr you can use ``--ssl-rootcert`` option. If proper rootCA certificate is not installed or specified by option, livereload feature will not work.\n\nFor more options see ``adev runserver --help``.\n\nserve\n~~~~~\n\nSimilar to `runserver`_ except just serves static files.\n\nUsage is simply\n\n.. code:: shell\n\n    adev serve \u003cpath-to-directory-to-serve\u003e\n\nLike ``runserver`` you get nice live reloading and access logs. For more options see ``adev serve --help``.\n\nTutorial\n--------\n\nTo demonstrate what adev can do when combined with create-aio-app, let's walk through creating a new application:\n\nFirst let's create a clean python environment to work in and install aiohttp-devtools and create-aio-app.\n\n(it is assumed you've already got **python**, **pip** and **virtualenv** installed)\n\n.. code:: shell\n\n    mkdir my_new_app \u0026\u0026 cd my_new_app\n    virtualenv -p `which python3` env\n    . env/bin/activate\n    pip install aiohttp-devtools create-aio-app\n\n\nWe're now ready to build our new application with ``create-aio-app`` and we'll name the\nproject ``my_new_app`` after the current directory.\n\nWe're going to explicitly choose no database here to make this tutorial easier, but you can remove that option\nand choose to use a proper database if you like.\n\nYou can just hit return to choose the default for all the options.\n\n\n.. code:: shell\n\n    create-aio-app my_new_app --without-postgres\n\nThat's it, your app is now created. You might want to have a look through the local directory's file tree.\n\nBefore you can run your app you'll need to install the other requirements, luckily they've already been listed in\n``requirements/development.txt`` by ``create-aio-app``, to install simply run\n\n.. code:: shell\n\n    pip install -r requirements/development.txt\n\nYou can then run your app with just:\n\n.. code:: shell\n\n    adev runserver\n\nWith that:\n\n* your app should be being served at ``localhost:8000`` (you can go and play with it in a browser).\n* Your static files are being served at ``localhost:8001``, adev has configured your app to know that so it should be rendering properly.\n* any changes to your app's code (``.py`` files) should cause the server to reload, changes to any files\n  (``.py`` as well as ``.jinja``, ``.js``, ``.css`` etc.) will cause livereload to prompt your browser to reload the required pages.\n\n**That's it, go develop.**\n\n.. |Coverage| image:: https://codecov.io/gh/aio-libs/aiohttp-devtools/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/aio-libs/aiohttp-devtools\n.. |pypi| image:: https://img.shields.io/pypi/v/aiohttp-devtools.svg\n   :target: https://pypi.python.org/pypi/aiohttp-devtools\n.. |license| image:: https://img.shields.io/pypi/l/aiohttp-devtools.svg\n   :target: https://github.com/aio-libs/aiohttp-devtools\n.. _Changes.txt: /CHANGES.txt\n.. _livereload: https://github.com/livereload/livereload-js\n.. _aiohttp: http://aiohttp.readthedocs.io/en/stable/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faio-libs%2Faiohttp-devtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faio-libs%2Faiohttp-devtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faio-libs%2Faiohttp-devtools/lists"}