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.
22 lines
501 B
22 lines
501 B
#!/usr/bin/env python
|
|
# -*- coding:utf-8 -*-
|
|
# project: fir_ser
|
|
# filename: getip
|
|
# author: liuyu
|
|
# data: 2022/3/28
|
|
|
|
import logging
|
|
|
|
from rest_framework.response import Response
|
|
from rest_framework.views import APIView
|
|
|
|
from common.base.baseutils import get_real_ip_address
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class GetRemoteIp(APIView):
|
|
|
|
def get(self, request):
|
|
logger.info(f"real_ip:{get_real_ip_address(request)}")
|
|
return Response({'real_ip': get_real_ip_address(request)})
|
|
|