Skip to main content

aiohttp-devtools

Coverage pypi license

Dev tools for aiohttp.

aiohttp-devtools provides a number of tools useful when developing applications with aiohttp and associated libraries.

Installation

pip install aiohttp-devtools

Usage

The aiohttp-devtools CLI (and it’s shorter alias adev) consist of two sub-commands: runserver and serve.

runserver

Provides a simple local server for running your application while you’re developing.

Usage is simply

adev runserver <app-path>

Note: adev runserver <app-path> will import the whole file, hence it doesn’t work with web.run_app(app). You can however use if __name__ == '__main__': web.run_app(app).

app-path can be a path to either a directory containing a recognized default file (app.py or main.py) or to a specific file. The --app-factory option can be used to define which method is called from the app path file, if not supplied some default method names are tried (namely app, app_factory, get_app and create_app, which can be variables, functions, or coroutines).

All runserver arguments can be set via environment variables.

runserver has a few useful features:

  • livereload will reload resources in the browser as your code changes without having to hit refresh, see livereload for more details.

  • 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. Pass -s/--static <path> to enable; without it static files aren’t served and only full-page livereloads are issued for non-.py changes.

The --ssl-context-factory option can be used to define method from the app path file, which returns ssl.SSLContext for ssl support. If You are going to use self-signed certificate for your dev server, you should install proper rootCA certificate to your system. Or you can use --ssl-rootcert option. If proper rootCA certificate is not installed or specified by option, livereload feature will not work.

For more options see adev runserver --help.

serve

Similar to runserver except just serves static files.

Usage is simply

adev serve <path-to-directory-to-serve>

Like runserver you get nice live reloading and access logs. For more options see adev serve --help.

Tutorial

To demonstrate what adev can do when combined with create-aio-app, let’s walk through creating a new application:

First let’s create a clean python environment to work in and install aiohttp-devtools and create-aio-app.

(it is assumed you’ve already got python, pip and virtualenv installed)

mkdir my_new_app && cd my_new_app
virtualenv -p `which python3` env
. env/bin/activate
pip install aiohttp-devtools create-aio-app

We’re now ready to build our new application with create-aio-app and we’ll name the project my_new_app after the current directory.

We’re going to explicitly choose no database here to make this tutorial easier, but you can remove that option and choose to use a proper database if you like.

You can just hit return to choose the default for all the options.

create-aio-app my_new_app --without-postgres

That’s it, your app is now created. You might want to have a look through the local directory’s file tree.

Before you can run your app you’ll need to install the other requirements, luckily they’ve already been listed in requirements/development.txt by create-aio-app, to install simply run

pip install -r requirements/development.txt

You can then run your app with just:

adev runserver

With that:

  • your app should be being served at localhost:8000 (you can go and play with it in a browser).

  • Your static files are being served at localhost:8001, adev has configured your app to know that so it should be rendering properly.

  • any changes to your app’s code (.py files) should cause the server to reload, changes to any files (.py as well as .jinja, .js, .css etc.) will cause livereload to prompt your browser to reload the required pages.

That’s it, go develop.

Metadata

Release files for aiohttp-devtools 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiohttp-devtools 1.2.0
File Size Uploaded Provenance Actions
aiohttp_devtools-1.2.0.tar.gz 54.2 kB Without provenance Details for aiohttp_devtools-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aiohttp-devtools 1.2.0
File Interpreter ABI Platform Actions
aiohttp_devtools-1.2.0-py311.py312.py313-none-any.whl Python 3.12, Python 3.13, Python 3.11 none any Details for aiohttp_devtools-1.2.0-py311.py312.py313-none-any.whl

Total release size: 96.6 kB

Release files / aiohttp_devtools-1.2.0.tar.gz

Download URL aiohttp_devtools-1.2.0.tar.gz
Size 54.2 kB
Tags Source
SHA-256 checksum
How to use checksums
918b9a4d5ee26f345ae46584c3977d9a4e363e160ec4b26b18e30b799cb82518
BLAKE2b-256 checksum
How to use checksums
671b3b23d562108c1ef8118daea5fc70adf7d592da78f58b0d51ab5e0796f2c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / aiohttp_devtools-1.2.0-py311.py312.py313-none-any.whl

Download URL aiohttp_devtools-1.2.0-py311.py312.py313-none-any.whl
Size 42.4 kB
Tags Python 3.11 Python 3.12 Python 3.13
SHA-256 checksum
How to use checksums
e88755f6468f2b78e57a6ddfff1668ceaa0b491a6e4bc7fe962223cf81d3631d
BLAKE2b-256 checksum
How to use checksums
60b73b779b8e97e666e17f8d3e3033f11b7931dc8fb59be4fa9c0f05a88f304c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for aiohttp-devtools 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page