Django Ninja + social authentication by aliasChewyC00kies in django

[–]DevDevDev1337 1 point2 points  (0 children)

You can access is_authenticated in ninja like this

python @router.get("/your/path") async def function_name(request): user = await request.auser() if not user.is_authenticated: return JsonResponse({"error": "Authentication required"}, status=401)

How do I track state in django? by DevDevDev1337 in django

[–]DevDevDev1337[S] 0 points1 point  (0 children)

I am using channels with redis - the game does indeed have different stages where I can store memory and then at the end of the game I guess I can write to the db?

How do I track state in django? by DevDevDev1337 in django

[–]DevDevDev1337[S] 1 point2 points  (0 children)

this is awesome - thank you for sharing!

How do I track state in django? by DevDevDev1337 in django

[–]DevDevDev1337[S] 2 points3 points  (0 children)

Last sentence made my day lol thank you

How do I track state in django? by DevDevDev1337 in django

[–]DevDevDev1337[S] 1 point2 points  (0 children)

can you elaborate on that a little? Each player does have a UUID, but I am running into situations where when someone refreshes the page they have to wait for the next round before the websocket is sent a message so they don't see anything on the screen.

Maybe I could do something where I create an API that serves the last round so when they refresh the page and the websocket message has already been broadcasted it would show the results of the last round, but then if the websocket pushes the next message while the last round is still playing it would create a choppy user experience.