[Fixed]-ModuleNotFoundError: No module named 'models'

25👍

You need to use relative import

from . import models

Or it’s better to import models that you will use, since it won’t visually collide with django.db.models.

from django import forms

from .models import VolunteerBasicInfo

class BasicInfoCollectionForm(forms.ModelForm):
    class Meta:
        model = VolunteerBasicInfo
        ...

You also don’t need to use brackets with class Meta.

0👍

Thanks i had this error because i forgot the dot

project/base/admin.py

from .models import Tarea

(Before i texted from models import Tarea

Leave a comment