I am using Django 'dumpdata' to export database table to Geojson file.
$python manage.py dumpdata --format=geojson > test.geojson
However, the geojson file does not contain pk (auto incremented integer). Is there any way to export the pk to the geojson file?
You could try creating a
serializers.pyin one of your apps, and subclass the geojson serializer fromdjango.contrib.gis.In your app config, you will need to register your serializers module so that you can use it with the
dumpdatacommand. You can see how the gis app does it here.