We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MissingDependencyError
__main__
Hello
# app.py import aiohttp.web import punq from project import routes class A: pass if __name__ == "__main__": container = punq.Container() container.register(A, instance=A()) app = aiohttp.web.Application() app["container"] = container routes.setup_routes(app) aiohttp.web.run_app(app)
# routes.py import aiohttp.web from project import view def setup_routes(app: aiohttp.web.Application): app.router.add_route("GET", "/route", view.handler)
# view.py import aiohttp.web import punq from project import app async def handler(r: aiohttp.web.Request): c: punq.Container = r.app["container"] c.resolve(app.A) return aiohttp.web.Response()
Request to /route results in MissingDependencyError because it exists as __main__.A as I understand
/route
__main__.A
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello
Request to
/route
results inMissingDependencyError
because it exists as__main__.A
as I understandThe text was updated successfully, but these errors were encountered: