【发布时间】:2022-01-03 22:36:07
【问题描述】:
我正在尝试添加模型,但每当我运行 python manage.py makemigrations 时,我都会收到以下错误
ModuleNotFoundError: No module named 'django.contrib.staticfilesaccounts'
accounts是我项目中的一个app,文件结构如下 file structure
模型文件是,
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
我是 Django 初学者,需要一些帮助。非常感谢
【问题讨论】:
标签: django django-models makemigrations