You can also set the value directly.
import jsonfrom factory import LazyAttributefrom factory.django import DjangoModelFactoryclass PlaceFactory(DjangoModelFactory): static_location = "{'type': 'Point', 'coordinates': [1,1]}" random_location = LazyAttribute(lambda x: json.dumps({'type': 'Point','coordinates': [random.uniform(-180.0, 180.0), random.uniform(-180.0, 180.0)]} ))