Defining a model class in Django shell fails

后端 未结 3 2080
时光说笑
时光说笑 2020-12-15 03:54

when I use the Django shell, it shows an error; this is the error:

>>> from django.db import models
>>> class Poll(models.Model):
...     q         


        
3条回答
  •  佛祖请我去吃肉
    2020-12-15 04:39

    I ran into this problem using Eclipse, Django and PyDev. I needed to have the application (instead of some .py file for example) selected in the PyDev Package Explorer (left panel) before clicking Run for everything to work properly.

提交回复
热议问题