我正在为API使用django-rest-framework,但是当我发出发布请求时会向我发送此错误:
{
"location": [
"Invalid format: string or unicode input unrecognized as GeoJSON, WKT EWKT or HEXEWKB."
]
}
Run Code Online (Sandbox Code Playgroud)
正文要求:
{
"location":{
"type":"Point",
"coordinates":[37.0625,-95.677068]
}
}
Run Code Online (Sandbox Code Playgroud)
我的模型如下:
class Address(models.Model):
location = geo.PointField(srid=4326, blank=True)
objects = geo.GeoManager()
Run Code Online (Sandbox Code Playgroud)
我的序列化器如下:
class AddressCreateSerializer(serializers.ModelSerializer):
class Meta:
model = Address
fields = ('location')
Run Code Online (Sandbox Code Playgroud)
请帮帮我!