问题描述:
1.我在mysite/settings.py文件中定义了一个全局变量,定义方法如下:
MODEL = ‘Student’
2.然后在app/models.py中定义一个model,定义方法如下:
from mysite.settings import MODEL
class MODEL(models.Model):
id_s = models.AutoField(primary_key=True)
name_s = models.CharField(max_length=25)
3.执行完命令python manager.py shell之后,敲入以下内容,之后报错
>>> from app.models import Student
报错:
Traceback (most recent call last):
File "<console>", line 1, in <module>
ImportError: cannot import name Student
请问有什么好点子?