sanic

Faster way of redirecting all requests to sanic?

Faster way of redirecting all requests to sanic? Question: localhost:5595/example/hi it would forward to a website Asked By: BaneLeaks || Source Answers: I am not 100% sure if this is the answer you are looking for. But, if you are asking about making a super crude proxy server in Sanic to redirect all requests, something …

Total answers: 1

Combine multiple routes into one serverless function in Vercel using Python?

Combine multiple routes into one serverless function in Vercel using Python? Question: I currently have a Nextjs app with python api backend. The problem I am running into is that Vercel has a limit of 24 Serverless functions and they seem to recommend that one should combine your serverless functions to "optimize" your functions and …

Total answers: 1

RuntimeError: this event loop is already running

RuntimeError: this event loop is already running Question: I am trying to run an asynchronous 3rd party file upload using the following code in sanic def up(self,request): import asyncio import aiohttp header = { ‘Authorization’: ‘Client-ID {}’.format(self.client_id) } data = { ‘image’: open(“/home/jibin/Downloads/test.jpg”, “rb”) } async def upload(data): async with aiohttp.ClientSession() as session: async with …

Total answers: 1

Retrieving config from a blueprint in Sanic app

Retrieving config from a blueprint in Sanic app Question: I have a Sanic application, and want to retrieve app.config from a blueprint as it holds MONGO_URL, and I will pass it to a repository class from the blueprint. However, I could not find how to get app.config in a blueprint. I have also checked Flask …

Total answers: 4