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
- Django template variable value to string literal comparison fails
- In Django, how do you retrieve a field of a many-to-many related class?
- How to set "simple" password in Django 1.9
Source:stackexchange.com