Add hexa id generator
This commit is contained in:
12
kivi_cars/Generator/views.py
Normal file
12
kivi_cars/Generator/views.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from rest_framework.decorators import api_view
|
||||
from rest_framework.response import Response
|
||||
import secrets
|
||||
|
||||
# Create your views here.
|
||||
|
||||
@api_view(['GET'])
|
||||
def HexaGenerator(request):
|
||||
if request.method == 'GET':
|
||||
hexa_id = secrets.token_hex(16)
|
||||
return Response({"message": "Search id:", "data": hexa_id})
|
||||
|
||||
Reference in New Issue
Block a user