python - django cannot import name 'Item' -
after running successful runserver,
create super user in django project, updated admin.py in app directory
from django.contrib import admin .models import item admin.site.register(item)
by running following
$: python manage.py createsuperuser; getting below error
i newbie django , python, read in other post circular import couldn't figure out error.
i have taken tutorial python , django youtube.
you have identified problem in comment:
models.py : django.db import models
item
not comes django. need define model named item
yourself. guess ahve missed pretty important step in tutorial (or tutorial wrong/missing step). app running in meantime add models.py:
from django.db import models class item(models.model): pass
this should allow create superuser. aware model doesn't anything. either have find missing step of tutorial or figure out supposed doing.
Comments
Post a Comment