Reputation: 5
I tried makemigrations and i get:
from SocialNetwork.Accounts.models import User ModuleNotFoundError: No module named 'SocialNetwork.Accounts''=
I made a few applications, installed it in settings, and even pycharm sees it, but I get the error shown above.
This is my project structure:
-SocialNetwork (main directory)
-SocialNetwork (project package)
-Accounts
-__init__.py
-admin.py
-apps.py
-models.py
-tests.py
-urls.py
-views.py
-Chats
-__init__.py
-admin.py
-apps.py
-models.py
-tests.py
-urls.py
-views.py
-Other apps
-SocialNetwork (settings, wsgi, urls etc)
And tried install models from account in chats:
from django.db import models
from SocialNetwork.Accounts.models import User
class Chat(models.Model):
firstUser = models.ForeignKey(User, on_delete=models.CASCADE)
secondUser = models.ForeignKey(User, on_delete=models.CASCADE)
I doubt that it will be helpful but i can write models from user:
class User(models.Model):
name = models.CharField(max_length=50, null=True)
phone = models.PhoneNumberField()
dateBirth = models.DateField(blank=True, null=True)
description = models.CharField(max_length=200, blank=True, null=True
I have been sitting with this for 2 hours, what can I do in this case? Maybe something more with settings or structure? But structure seems be as always in django projects. Any help will be appreciated, I am new in django.
Upvotes: 0
Views: 73