How to resolve error 404 in postman with SpringBoot REST?

I am new to spring boot and i have been trying to get a simple api request via postman. But, I am stuck with an error 404. Can someone point the errors in my code?. I have a spring boot simple app build with maven and run in embedded tomcat through STS. I tried to… Read More How to resolve error 404 in postman with SpringBoot REST?

How to get REST API JavaScript fetch object value to HTML?

How can I get printed console object value to HTML? I have JavaScript fetch code like this: const comments = fetch("https://api.github.com/repos/pieceofdiy/comments/issues/1") .then((response) => response.json()) .then((labels) => { return labels.comments; }); const printComments = () => { comments.then((number) => { console.log(number); }); }; printComments() printComments() numeric object value shows correct in console, but how to show… Read More How to get REST API JavaScript fetch object value to HTML?

How remove password from response in django

Code: SERILIZERS class RegisterSerializer(serializers.ModelSerializer): class Meta: model = User fields = ("email", "user_name", "password") def create(self, validated_data): return User.objects.create_user(**validated_data) VIEWS @api_view(["POST"]) @permission_classes([AllowAny]) def CreateUserView(request): serializer = RegisterSerializer(data=request.data) if serializer.is_valid(): user = serializer.save() if user: return Response(serializer.data, status=status.HTTP_201_CREATED) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) MODELS class CustomAccountManager(BaseUserManager): def create_user(self, email, user_name, password, **other_fields): if not email: raise ValueError(_("You must… Read More How remove password from response in django

Differnece between @path variable vs @queryParan

When we can use @path variable vs when we can use @queryParameter >Solution : For instance, let’s say you want to have an url for fetching a specific order with id: OR-21345678 The "template" url you probably will have would look like this: https://example.org/order/{id}, therefore the url for the order OR-21345678 would be: https://example.org/order/OR-21345678. As… Read More Differnece between @path variable vs @queryParan

Why python want us this : Non-default argument follows default argument

class Node(): def __init__(self,value,parrent=None,neigh) -> None: self.val=value self.parrent=parrent self.neigh=neigh Here I want to define a class. There is an error about neigh that non-default argument follows default argument. I saw the solution of this question but my main question is I want to know why python want us to do this? >Solution : Because Python… Read More Why python want us this : Non-default argument follows default argument