Error Message: ModuleNotFoundError: No module named 'projects'

I am working on a Django application where I am trying to webscrape data and then insert the data into the Django ORM to be able to render it using HTML. However, when I try to connect to the models.py file in the projects folder in the webscrape.py file I get an error message: "ModuleNotFoundError: No module named 'projects'."

Here is my project structure: app projects init.py models.py tests.py views.py urls.py admin.py Scripts Webscrape.py init.py`

Here is the code inside my webscrape.py file: from projects.models import Weather

Here is the code inside my models.py file: from django.db import models class Weather(models.Model): Date = models.DateField(blank=False, default='1900-01-01',) Temperature = models.CharField(max_length=15)

INSTALLED_APPS = [ 'pages.apps.PagesConfig', 'projects.apps.ProjectsConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'huey.contrib.djhuey', 'Scripts', ]

I have tried to update the sys.path with no avail and keep getting an error message. Any help is much appreciated!

Back to Top