|
@@ -30,6 +30,7 @@ from Model.models import Order_Model, Store_Meal, DeviceLogModel, VodBucketModel
|
|
TestSerialRepetition, TestDeviceFindSerial, UIDCompanySerialModel, CompanySerialModel, LogModel, Device_User
|
|
TestSerialRepetition, TestDeviceFindSerial, UIDCompanySerialModel, CompanySerialModel, LogModel, Device_User
|
|
from Object.AWS.AmazonS3Util import AmazonS3Util
|
|
from Object.AWS.AmazonS3Util import AmazonS3Util
|
|
from Object.AliPayObject import AliPayObject
|
|
from Object.AliPayObject import AliPayObject
|
|
|
|
+from Object.IPQueryObject import IPQuery
|
|
from Object.RedisObject import RedisObject
|
|
from Object.RedisObject import RedisObject
|
|
from Object.ResponseObject import ResponseObject
|
|
from Object.ResponseObject import ResponseObject
|
|
from Object.TokenObject import TokenObject
|
|
from Object.TokenObject import TokenObject
|
|
@@ -569,11 +570,17 @@ class testView(View):
|
|
return HttpResponse(json.dumps(response, ensure_ascii=False),
|
|
return HttpResponse(json.dumps(response, ensure_ascii=False),
|
|
content_type="application/json,charset=utf-8")
|
|
content_type="application/json,charset=utf-8")
|
|
|
|
|
|
- def ip(self, response):
|
|
|
|
- ip = '67.220.90.13'
|
|
|
|
- country_id = Device_Region().get_device_region(ip)
|
|
|
|
- print(country_id)
|
|
|
|
- return response.json(0)
|
|
|
|
|
|
+ @staticmethod
|
|
|
|
+ def ip(response):
|
|
|
|
+ ip = '120.237.157.181'
|
|
|
|
+ try:
|
|
|
|
+ ip_qs = IPQuery(ip)
|
|
|
|
+ district, city = ip_qs.district, ip_qs.city
|
|
|
|
+ addr = '{}/{}'.format(district, city)
|
|
|
|
+ print(addr)
|
|
|
|
+ return response.json(0, {ip: addr})
|
|
|
|
+ except Exception as e:
|
|
|
|
+ return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
def configType(self, response):
|
|
def configType(self, response):
|
|
print(SERVER_TYPE)
|
|
print(SERVER_TYPE)
|