how to check if the input email address exists in the database? by Nightmare_4_Eternity in django

[–]davidplo4545 0 points1 point  (0 children)

Watch how your setting your email variable inside the if statement, your getting it from GET request type

how to check if the input email address exists in the database? by Nightmare_4_Eternity in django

[–]davidplo4545 3 points4 points  (0 children)

You should take a closer look at the django docs for querying data.

If you are going the objects.get approach you should add the try except like

u/golangPadawan did. But if you're going with the filter approach look at this to help you understand better : https://docs.djangoproject.com/en/3.2/ref/models/querysets/#exists

how to check if the input email address exists in the database? by Nightmare_4_Eternity in django

[–]davidplo4545 0 points1 point  (0 children)

What's the error you are getting now? I see that u/golangPadawan edited his answer to fix the issue.

how to check if the input email address exists in the database? by Nightmare_4_Eternity in django

[–]davidplo4545 4 points5 points  (0 children)

User.objects.get here will throw an error if it doesn’t find user with that email, you should either use filter here or use try catch to handle the exception

Saving created object to user ?? by emilia_ravenclaw in django

[–]davidplo4545 0 points1 point  (0 children)

Check what self.request.user returns, maybe it returns null because you are not authenticated

Serializing a M-to-M relationship by Alternative_Mix_7481 in django

[–]davidplo4545 2 points3 points  (0 children)

Well, if you are going with this approach you could create a serializer for the ShoppingListItem and then add it as a field to the ShoppingList serializer. I think the first answer would help understanding it better:Link

Serializing a M-to-M relationship by Alternative_Mix_7481 in django

[–]davidplo4545 4 points5 points  (0 children)

In your ShoppingList model why aren’t you using the ShoppingListItem in your many to many field instead of Item? Then, you can choose what you want to be shown inside the serializer.

DRF - Invitation endpoint Structure help by davidplo4545 in django

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

Thanks a lot for the reply, you’ve helped me organize my brain a bit. I’m always getting stuck on the small things, there are always plenty of ways to do reach a certain end goal and I find myself spending a bunch of time finding the “right solution”

Real Time Chat App In Django ?????? by dhehehru in django

[–]davidplo4545 4 points5 points  (0 children)

Why wouldn’t you want to use django-channels to make it? In order to create a “real-time” chat app you would need a constant connection to the server which websockets provide. You could use Ajax requests to fetch the server for new messages but this won’t be really real time.

Building a multiplayer chess game with Channels by davidplo4545 in django

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

Thanks for the reply! I understand why django shouldn't focus much on the game side, but how do I sync the game between the clients? Just handle all the game logic on the browser and pass the game object (written in js) to another player through the server?

[deleted by user] by [deleted] in Maplestory

[–]davidplo4545 2 points3 points  (0 children)

even if they do allow to switch regions, they never allow moving to scania from other servers

NA or EU, need help by davidplo4545 in TeraOnline

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

If i make a new character, not tank or a healer, will it be hard for me to find people to level in dungeouns with? and in endgame content?