0

I have a django project and I need to import models into another folder which is in a sub directory which is in the same folder as the file I am trying to import to...

I am trying to import classes from models into profileViews.py This is what I have right now:

from .models import Profile

here isthe directory setup

enter image description here

Omar Jandali
  • 814
  • 3
  • 20
  • 52

1 Answers1

0

You can use either a relative import:

from ..models import Profile

Where "Profile is the model class you want.

Or, import absolutely with the app name "splitt":

from splitt.models import Profile

miked
  • 61
  • 1