[Answer]-Import relative apps in Django

1👍

I think your structure is fine. Basically, python’s modules are just a python file which you may import like this: import <filename> and you will have its functionality imported. But when you group some python files in a folder and include in that folder a file called init.py there you have a python package. With is a better way to manage a group of modules and it allows the dot notation in your imports. Django apps behave like packages as you may see.

If you want to import Profile within your video module then you have to do this:

from profile.models import Profile

That is, assuming that the Profile model is defined in your profile app in models.py. That should do.

If you want more information about python project structure this is a great place.

Leave a comment