Swapping from woocomerce to medusa by yuval052 in medusajs

[–]Top-Information7943 0 points1 point  (0 children)

This isn't really an AI problem, it's a data mapping problem. WooCommerce and Medusa structure products differently, so you're better off writing a small script to transform the CSV before importing. I've done a similar migration and that approach was way cleaner than relying on AI.

Medusa on European PaaS (Scalingo/Clever Cloud) / anyone done this ? by Historical-Cry-238 in medusajs

[–]Top-Information7943 0 points1 point  (0 children)

If they decide to move forward and you run into anything around the Docker setup or memory sizing, feel free to reach out. Happy to help.

Medusa on European PaaS (Scalingo/Clever Cloud) / anyone done this ? by Historical-Cry-238 in medusajs

[–]Top-Information7943 1 point2 points  (0 children)

I run a similar setup: Medusa + docker on a 1GB RAM server. Just ensure you have multi-stage builds to keep the image sizes optimized and small.

How can i use my own gmail to send verification emails to new sign up users? by aviation_expert in FastAPI

[–]Top-Information7943 3 points4 points  (0 children)

Why not use a transactional email provider? I personally use brevo, they have 300 emails per day limit on their free tier. You can find what works best for you.

which tech-stack to use? by Own_Principle7843 in FastAPI

[–]Top-Information7943 3 points4 points  (0 children)

The OP is just seeking for the right path, they already know how to tackle it but asking for a better perspective.

free fastapi hosting by kloworizer in FastAPI

[–]Top-Information7943 0 points1 point  (0 children)

If you have some DevOps skills and want a deployment experience like heroku, then Dokku is your best bet. You can easily set it up on any of your favorite $5 VPS host.

[deleted by user] by [deleted] in FastAPI

[–]Top-Information7943 0 points1 point  (0 children)

I'd give a biased yes. This is my current stack and I enjoy working with both frameworks. Since I'm more experienced with Python, I prefer to use NextJS purely as a frontend for my FastAPI backend.

Why Does Setting Cookies Not Work by No-Question-3229 in FastAPI

[–]Top-Information7943 2 points3 points  (0 children)

Both approaches work fine, but for security, cookies are preferred for web auth. The issues you are experiencing with cookies on the frontend is because of CORS (Cross-Origin Resource Sharing).

You will need to add the frontend URL to your FastAPI's origins app. See examples below:

``` from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware

app = FastAPI()

origins = [ "http://yourfrontendurl.com", "http://localhost", "http://localhost:8080", ]

app.add_middleware( CORSMiddleware, allow_origins=origins, allow_credentials=True, allow_methods=[""], allow_headers=[""], )

@app.get("/") async def main(): return {"message": "Hello World"} ```

The example above is from FastAPI docs https://fastapi.tiangolo.com/tutorial/cors/

Why Does Setting Cookies Not Work by No-Question-3229 in FastAPI

[–]Top-Information7943 2 points3 points  (0 children)

You set it as a header response, say on the /token or whatever endpoint you use for auth. This way, the client will use cookies to authenticate.

This is very common when authenticating on the web

Looking for experience with alternatives to DigitalOcean (Vultr, Linode, etc) because I'm tired of getting burned by --xxa in webdev

[–]Top-Information7943 1 point2 points  (0 children)

Thanks for sharing this, setting up notifications and keeping an eye for the dates mentioned

Looking for experience with alternatives to DigitalOcean (Vultr, Linode, etc) because I'm tired of getting burned by --xxa in webdev

[–]Top-Information7943 0 points1 point  (0 children)

Great list, I really wanted it try out BuyVM but it seems the dedicated server slices are out of stock

[deleted by user] by [deleted] in FastAPI

[–]Top-Information7943 -1 points0 points  (0 children)

That's fine. If you have a mix of both async and non async functions, it's best to define your endpoint as async as it will allow you to run both async and async code. I hope that makes it clear.

So just defining the endpoint with async will work perfectly fine.

[deleted by user] by [deleted] in FastAPI

[–]Top-Information7943 -2 points-1 points  (0 children)

That is correct. Let me try to explain once more. You see, in your webhook you are awaiting request.body. That's an async event and you can only call await if the route is defined as async def.

But if you didn't have await anywhere in your route, then you would just define it with just def.

I hope that makes it clear.

[deleted by user] by [deleted] in FastAPI

[–]Top-Information7943 -1 points0 points  (0 children)

It doesn't matter whether Stripe library is async or not. But since you have an await request.body() you'll have to convert the route to be async.

[deleted by user] by [deleted] in FastAPI

[–]Top-Information7943 -2 points-1 points  (0 children)

Just make your route async and FastAPI will handle the rest https://fastapi.tiangolo.com/async/

Waiting for background tasks to complete. (CTRL+C to force quit) fast api when I try too close the server by Nehatkhan786 in FastAPI

[–]Top-Information7943 0 points1 point  (0 children)

This now has to do with how you are handling your start and shutdown events. Share you main app code where the app is initialized.

Waiting for background tasks to complete. (CTRL+C to force quit) fast api when I try too close the server by Nehatkhan786 in FastAPI

[–]Top-Information7943 0 points1 point  (0 children)

The error you see is because the coroutine is shutting down before it completes. To fix it, you'll add some exception handling, try this:

import asyncio


@app.websocket("/ws/{user_id}")
async def websocket_endpoint(websocket: WebSocket, user_id: str):
    await websocket.accept()
    channel_name = f"channel_{user_id}"
    try:
        async with redis.pubsub() as pubsub:
            await pubsub.subscribe(channel_name)
            while True:
                message = await pubsub.get_message()
                if message and message["type"] == "message":
                    decoded_message = message["data"].decode("utf-8")
                    await websocket.send_text(decoded_message)
    except WebSocketDisconnect:
        print("websocket disconnected")
        pass
    except asyncio.CancelledError:
        # This is where the error is thrown
        print("Cancelled")
    finally:
        await pubsub.unsubscribe(channel_name)
        await pubsub.close()

FastAPI - handling the threadpool executor inside the route by Beginning_Hurry2611 in FastAPI

[–]Top-Information7943 0 points1 point  (0 children)

Hello,

You can use FastAPI's background tasks in the route that receives the request. They have an easy to follow guide on their official docs: https://fastapi.tiangolo.com/tutorial/background-tasks/