1

I am trying to add models, but whenever I run python manage.py makemigrations I get the following error

ModuleNotFoundError: No module named 'django.contrib.staticfilesaccounts'

accounts is an app in my project, the structure of the files is as follows file structure

The models file is,

from django.db import models

    # Create your models here.
    
    class Customer(models.Model):
        name=models.CharField(max_length=200, null=True)
        phone=models.CharField(max_length=10, null=True)
        email=models.EmailField(max_length=20, null=True)
        dateCreated=models.DateField(auto_now_add=True)
    
        def __str__(self):
            return self.name
    
    class Product(models.Model):
        name=models.CharField(max_length=30, null=True)
        category=models.CharField(max_length=20, null=True)
        price=models.IntegerField(null=True)
    
        def __str__(self):
            return self.name

Im a Django beginner, could use some help. Much Thanks

Qwerty
  • 13
  • 3

1 Answers1

1

There is a typo in INSTALLED_APPS in the settings.py file, it should be like this:

INSTALLED_APPS = [
    # ...
    'django.contrib.staticfiles',
    'accounts',
    #...
]
mamume
  • 48
  • 1
  • 5
  • yes the INSTALLED_APPS contains 'django.contrib.staticfiles' but I dont understand why django is looking for 'django.contrib.staticfilesaccounts' – Qwerty Jan 04 '22 at 00:44
  • Make sure that there is a comma after `'django.contrib.staticfiles'` app. – mamume Jan 04 '22 at 00:59