Coder Social home page Coder Social logo

goodmanwen / aiohttp-debugmode Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 186 KB

Run aiohttp server in subprocess ,automatically reload while dependencies/statics modified , debugtoolbar included.

License: MIT License

Python 100.00%
aiohttp-debugtoolbar aiohttp-server

aiohttp-debugmode's Introduction

Hi๐Ÿ‘‹, this is WEN

๐Ÿ‘ท Full Stack Developer

๐Ÿ“Š Data Science & High Performance Computing

Feel free to contact.

More...

๐Ÿ˜Ž A Little More About Me...

GoodManWEN := &Info {
    Name: "WEN",
    Occupation: "Full Stack Developer",
    Website: "https://nazorip.site",
    Location: "Liverpool, UK"
}

โšก Tech Stack

Frameworks
FastAPI Vue Spring Tensorflow Numpy

Tools
Redis MySQL Oracle Celery Elasticsearch TravisCI Docker Nginx

Others
Linux Debian Centos Raspberry Pi

aiohttp-debugmode's People

Contributors

goodmanwen avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jazellesclutter

aiohttp-debugmode's Issues

Server does not work when Application created inside function, requests fail with "curl: (56) Recv failure: Connection reset by peer"

server.py:

from aiohttp import web
from aiohttp.abc import Application

routes = web.RouteTableDef()

@routes.get('/favicon.ico')
async def icon(request):
    return web.json_response({'status': 'OK'})


def init_app() -> Application:
    app = web.Application()
    app.add_routes(routes)

    return app


if __name__ == '__main__':
    from aiohttp_debugmode import Debugmode

    app_from_init = init_app()
    Debugmode.run_app(app_from_init, port=80) # This way all requests fail

This gives no logs to stdout and all requests fail with curl: (56) Recv failure: Connection reset by peer.

If I change the last few lines to following:

if __name__ == '__main__':
    from aiohttp_debugmode import Debugmode

    inline_app = web.Application()
    inline_app.add_routes(routes)
    Debugmode.run_app(inline_app, port=80) # This way works

What am I missing here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.