All Projects → aio-libs → Aiohttp Devtools

aio-libs / Aiohttp Devtools

Licence: mit
dev tools for aiohttp

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Aiohttp Devtools

myke
make with yaml: development tasks made simple with golang, yaml and many ingredients
Stars: ✭ 67 (-66.83%)
Mutual labels:  development, devtools, developer-tools
Create Aio App
The boilerplate for aiohttp. Quick setup for your asynchronous web service.
Stars: ✭ 207 (+2.48%)
Mutual labels:  asyncio, aiohttp, cookiecutter
Kubernetes asyncio
Python asynchronous client library for Kubernetes http://kubernetes.io/
Stars: ✭ 147 (-27.23%)
Mutual labels:  asyncio, aiohttp
Aiozipkin
Distributed tracing instrumentation for asyncio with zipkin
Stars: ✭ 161 (-20.3%)
Mutual labels:  asyncio, aiohttp
Devspace
DevSpace - The Fastest Developer Tool for Kubernetes ⚡ Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes.
Stars: ✭ 2,559 (+1166.83%)
Mutual labels:  developer-tools, development
Fooproxy
稳健高效的评分制-针对性- IP代理池 + API服务,可以自己插入采集器进行代理IP的爬取,针对你的爬虫的一个或多个目标网站分别生成有效的IP代理数据库,支持MongoDB 4.0 使用 Python3.7(Scored IP proxy pool ,customise proxy data crawler can be added anytime)
Stars: ✭ 195 (-3.47%)
Mutual labels:  asyncio, aiohttp
Python Simple Rest Client
Simple REST client for python 3.6+
Stars: ✭ 143 (-29.21%)
Mutual labels:  asyncio, aiohttp
Gain
Web crawling framework based on asyncio.
Stars: ✭ 2,002 (+891.09%)
Mutual labels:  asyncio, aiohttp
Aiohttp
Asynchronous HTTP client/server framework for asyncio and Python
Stars: ✭ 11,972 (+5826.73%)
Mutual labels:  asyncio, aiohttp
Aiohttp Apispec
Build and document REST APIs with aiohttp and apispec
Stars: ✭ 172 (-14.85%)
Mutual labels:  asyncio, aiohttp
Linkedin Learning Downloader
Linkedin Learning videos downloader
Stars: ✭ 171 (-15.35%)
Mutual labels:  asyncio, aiohttp
Aiohttp Cors
CORS support for aiohttp
Stars: ✭ 173 (-14.36%)
Mutual labels:  asyncio, aiohttp
Aiohttp Security
auth and permissions for aiohttp
Stars: ✭ 195 (-3.47%)
Mutual labels:  asyncio, aiohttp
Aioinflux
Asynchronous Python client for InfluxDB
Stars: ✭ 142 (-29.7%)
Mutual labels:  asyncio, aiohttp
Bolt Python
A framework to build Slack apps using Python
Stars: ✭ 190 (-5.94%)
Mutual labels:  asyncio, aiohttp
Pymxget
mxget的Python实现
Stars: ✭ 136 (-32.67%)
Mutual labels:  asyncio, aiohttp
Prosemirror Dev Tools
Developer Tools for ProseMirror
Stars: ✭ 167 (-17.33%)
Mutual labels:  developer-tools, devtools
Aiohttp Jinja2
jinja2 template renderer for aiohttp.web
Stars: ✭ 180 (-10.89%)
Mutual labels:  asyncio, aiohttp
Backendschool2019
Приложение для практического руководства по разработке бекенд-сервисов на Python (на основе вступительного испытания в Школу бэкенд‑разработки Яндекса)
Stars: ✭ 129 (-36.14%)
Mutual labels:  asyncio, aiohttp
Works For Me
Collection of developer toolkits
Stars: ✭ 131 (-35.15%)
Mutual labels:  developer-tools, devtools

aiohttp-devtools

|Travis Build Status| |AppVeyor Build Status| |Coverage| |pypi| |license|

Dev tools for aiohttp_.

(Note: aiohttp-devtools>=0.8 only supports aiohttp>=3.0, if you're using older aiohttp, please use an older version of aiohttp-devtools, see History.rst_ for details.)

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

Installation

Requires python 3.5, python 3.6 or python 3.7.

.. code:: shell

pip install aiohttp-devtools

Usage

The aiohttp-devtools CLI (and it's shorter alias adev) consist of three sub-commands: runserver, serve and start_.

runserver


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

Usage is simply

.. code:: shell

    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
attributes, functions, or coroutines).

All ``runserver`` arguments can be set via environment variables, the `start`_ command creates a script
suitable for setting up your environment such that you can run the dev server with just ``adev runserver``.

``runserver`` has a few of 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

For more options see ``adev runserver --help``.

serve
~~~~~

Similar to `runserver`_ except just serves static files.

Usage is simply

.. code:: shell

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

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

start
~~~~~

Creates a new bare bones aiohttp app similar to django's "startproject".


Usage is simply

.. code:: shell

    adev start <path-to-directory-to-create-project-in>

This will generate an example **message board** app with some basic functionality: Messages can be added via posting to a form, they are stored in the database and then displayed in a list, and the session is used to pre-populate the user's name.

The app includes:

* Jinja2 template engine, via `aiohttp_jinja2`_
* encrypted cookie sessions using `aiohttp_session`_
* Postgres database, via `asyncpg`_

Tutorial
--------

To demonstrate what adev can do, let's walk through creating a new application:

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

(it is assumed you've already got **python 3.5**, **pip** and **virtualenv** installed)

.. code:: shell

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


We're now ready to build our new application with `start`_, using the current directory ``.`` will put files where
we want them and will prompt adev to 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.


.. code:: shell

    adev start . --database none

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.txt`` by `start`_, to install simply run

.. code:: shell

    pip install -r requirements.txt

(If you went off-piste and choose to use a database you'll need to edit ``activate.settings.sh`` to configure
connection settings, then run ``make reset-database`` to create a database.)

You can then run your app with just:

.. code:: shell

    source activate.settings.sh
    adev runserver

`runserver`_ uses the environment variables set in ``activate.settings.sh`` to decide how to serve your app.

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.**

.. |Travis Build Status| image:: https://travis-ci.com/aio-libs/aiohttp-devtools.svg?branch=master
   :target: https://travis-ci.com/aio-libs/aiohttp-devtools
   :alt: Travis status for master branch
.. |AppVeyor Build Status| image:: https://ci.appveyor.com/api/projects/status/abklub4k2spyutw7/branch/master?svg=true
   :target: https://ci.appveyor.com/project/aio-libs/aiohttp-devtools
   :alt: AppVeyor status for master branch
.. |Coverage| image:: https://codecov.io/gh/aio-libs/aiohttp-devtools/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/aio-libs/aiohttp-devtools
.. |pypi| image:: https://img.shields.io/pypi/v/aiohttp-devtools.svg
   :target: https://pypi.python.org/pypi/aiohttp-devtools
.. |license| image:: https://img.shields.io/pypi/l/aiohttp-devtools.svg
   :target: https://github.com/aio-libs/aiohttp-devtools
.. _History.rst: /HISTORY.rst
.. _livereload: https://github.com/livereload/livereload-js
.. _aiohttp: http://aiohttp.readthedocs.io/en/stable/
.. _aiohttp_jinja2: https://github.com/aio-libs/aiohttp_jinja2
.. _aiohttp_session: https://aiohttp-session.readthedocs.io/en/latest/
.. _asyncpg: https://magicstack.github.io/asyncpg/current/
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].