You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

31 lines
875 B

import random
from rest_framework.generics import GenericAPIView
from rest_framework.response import Response
from rest_framework import serializers
from rest_framework.authtoken.models import Token
from apps.account.models import User
class HomeSerializer(serializers.Serializer):
token = serializers.CharField()
from utils.countries import countries
# test class generate token
class HomeView(GenericAPIView):
serializer_class = HomeSerializer
def get(self, request):
# Get build_number from headers
build_number = request.META.get('HTTP_BUILD_NUMBER')
# Print the build_number
print(f"Build Number: {build_number}")
return Response({'token': "ok", 'build_number': build_number})
class CountryView(GenericAPIView):
def get(self, request):
return Response(countries, status=200)