This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Sequence | |
from functools import wraps | |
from dishka.container import Container | |
from dishka.integrations.base import wrap_injection | |
from django.urls import URLPattern | |
CONTAINER_NAME = "dishka_container" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dishka import Provider, Scope, provide | |
from faststream.rabbit import RabbitBroker | |
from settings import Config | |
from schemas import IUserInfo, UserRepo, Interactor | |
class SomeProvider(Provider): | |
@provide(scope=Scope.APP) | |
def get_configs(self) -> Config: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from contextlib import asynccontextmanager | |
from django.core.asgi import get_asgi_application | |
from starlette.applications import Starlette | |
from starlette.routing import Mount | |
from starlette.staticfiles import StaticFiles | |
from faststream.nats import NatsBroker | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from typing import Annotated, Any | |
from uuid import uuid4 | |
from faststream import FastStream, Context, context | |
from faststream.kafka import KafkaBroker | |
context.set_global("responses", {}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import wraps | |
from flask import Flask, request | |
from flask.scaffold import setupmethod | |
from fast_depends import inject | |
from fast_depends.library import CustomField | |
from pydantic import PositiveInt, ValidationError | |
class Body(CustomField): |