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 build 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 dont know how to complete it.

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

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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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