def Contries(request):
for country in pycountry.countries:
list.append(country.name)
if list:
return JsonResponse(
{"code": status.HTTP_200_OK, "success": True, "response": list},
status=status.HTTP_200_OK)
else:
return JsonResponse(
{"code": status.HTTP_400_BAD_REQUEST, "success": False, "response":"list"},
status=status.HTTP_400_BAD_REQUEST)
Is there any possibility to get the list of cities and states of given country using python