Type object 'Meta' has no attribute' model'

(venv3_ETC) [root@iZwz9hbv3lrr68d8bo5dvpZ goods]-sharp python views.py
Traceback (most recent call last):
File "views.py", line 5, in < module >

from .serializer import GoodsSerializer

ModuleNotFoundError: No module named"_ main__.serializer";"_ main__" is not a package

clipboard.png

clipboard.png

clipboard.png


should be a problem of module parsing. First of all, is there serializer.py and _ _ init__.py next to your views.py ? Both of these files exist so that you can import other modules in the python3 using the syntax of from .filename import moduleName , that is, under your own package ( package ).

Menu