python - I am trying to import a models.py method, but get error no module named -
i have 2 apps:
friends/apps/loginreg/models.py/user
friends/apps/friends/views.py
i trying import user method views.py
file.
these imports:
from __future__ import unicode_literals .models import friend loginreg.models import user django.shortcuts import render, redirect
it continues give error
no module named loginreg.models
the 'from' path wrong, think. try from ..loginreg.models import user
you're trying import folder above current one. can read more here.
Comments
Post a Comment