2
This Is My Models : 

class Intervention(models.Model):
        Titre_intervention = models.TextField(max_length=255)
        date_intervention = models.DateField(auto_now_add=True)
        type_panne = models.ForeignKey(Panne,on_delete=models.CASCADE)
        etat = models.CharField(max_length=30)
        description = models.TextField(max_length=255)
        image = models.ImageField(blank=True,null=True,upload_to='medial/%Y/%m/%D')
        equipements = models.ManyToManyField(Equipement)
        clients = models.ForeignKey(Client,on_delete=models.CASCADE,default=True)
        location = models.PointField(srid=4326)
        objects = models.GeoManager()

And This Is What I Imports :

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

So When I Run Makemigrations I got error Of :

AttributeError: module 'django.contrib.gis.db.models' has no attribute 'GeoManager'

daniel meyer
  • 67
  • 1
  • 8
  • Does this answer your question? [Cannot find the GeoManager in module django.contrib.gis.db. models in Django 2.0](https://stackoverflow.com/questions/48839817/cannot-find-the-geomanager-in-module-django-contrib-gis-db-models-in-django-2-0) – Mehak Jun 05 '20 at 15:14

1 Answers1

1

GeoManager has been removed.

A workaround that appears to function correctly:

Import in your models file:

from django.db.models import Manager as GeoManager

In your model class:

objects = GeoManager()
Michael Hawkins
  • 2,793
  • 1
  • 19
  • 33