i have a code structure like below. I'm sending a json data to my django server. I'm getting json data with webhook. but I want to do this in sync with asyncio.

Receiving json data No errors.

but the server gives an error "http 500". When I uninstall the async process, the application runs. but when I run it in async structure as below, it gives "http 500" error. how can i fix this situation?

json data I sent

{ "side": "BUY", "type": "MARKET", "symbol": "BCHUSDT", "cryptoType": "binancefutures", "timeLine": "5m" }

    # web hook receive json data
    @csrf_exempt
    def webhook(request):
        webhook_received_json = json.loads(request.body)
    
        queryset = CryptoInfo.objects.filter(status=True,
                                             symbol=webhook_received_json['symbol'],
                                             side=webhook_received_json['side'],
                                             memberStatus=True)
        table_data = serializers.serialize('json', queryset)
    
        for pair_list in json.loads(table_data):
            if pair_list['fields']['symbol'] == webhook_received_json['symbol'] and pair_list['fields']['status'] and \
                    pair_list['fields']['cryptoType']:
    
    
                # get active positions
                asyncio.run(get_active_position(futures_api_key=pair_list['fields']['futures_api_key'],
                                                futures_secret_key=pair_list['fields']['futures_secret_key'],
                                                side=pair_list['fields']['side'],
                                                symbol=pair_list['fields']['symbol']))
    
    
    
    
    
    async def get_active_position(futures_api_key, futures_secret_key, side, symbol):
    
        client = Client(futures_api_key, futures_secret_key)
    
        data = await client.futures_position_information()
    
        asyncio.run(
                        create_new_order(futures_api_key, futures_secret_key, side, symbol))
        return get_active_position
    
    
    
    
    async def create_new_order(futures_api_key, futures_secret_key, side, symbol):
        client = Client(futures_api_key, futures_secret_key)
        try:
            create_order = await client.futures_create_order(symbol=symbol,
                                                             type=Client.ORDER_TYPE_MARKET,
                                                             side=side,
                                                             quantity=15)
        except Exception as e:
            return "New order error :" + str(e)
        return create_new_order
    

    ``