In the new Django version support raster field and I follow this manual for GeoDjango raster field and this question for add raster I have built a simple demo.

Here the code :


postgis database backend



from django.db import models
from django.contrib.gis.db import models

class Elevation(models.Model):
    name = models.CharField(max_length=100)
    rast = models.RasterField()

All works fine without error. But I have one BIG question where I don't know how to complete it.

How do I display this raster in some web map like Leaflet?

  • geoserver can do this
    – ziggy
    Oct 7, 2021 at 14:49

1 Answer 1


You will need something to tile the raster and then serve these as tiles to Leaflet as if it was a background map. You probably want to use GeoServer or something similar to do this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.