I'm trying to import my app's models into my update.py located inside website/management/commands knowing that website is my application, the problem that i get is that there is no module named 'website' even that I've mentioned it in my Installed_APPS in my settings.py:
this is my update.py file :
from django.core.management.base import BaseCommand
import pandas as pd
#from website.models import Product
from website.models import Main_data
class Command(BaseCommand):
help='import booms'
def add_arguments(self, parser):
pass
def handle(self,*args,**options):
df=pd.read_excel('main.xlsx',engine='openpyxl')
for P_N,P_P,P_L,P_I,P_Logo in zip(df.Product_Name,df.price,df.Link,df.Image,df.Logo):
models=Data_Main(Product_Name=P_N,Product_Price=P_P,Product_Link=P_L,Product_Image=P_I,Product_Logo=P_Logo)
models.save()
this is the error that i get :
Traceback (most recent call last):
File "C:\Users\dell\Desktop\tam\website\management\commands\update.py", line 4, in <module>
from website.models import Main_data
ModuleNotFoundError: No module named 'website'
this is my INSTALLED_APPS section located in my settings.py :
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'website',
]