问答详情
源自:3-3 创建博客文章模型

'Primary_key'问题

  File "C:\Users\cjc\PycharmProjects\pythonProject3\demo\blog\models.py", line 4, in <module>

    class Article(models.Model):

  File "C:\Users\cjc\PycharmProjects\pythonProject3\demo\blog\models.py", line 6, in Article

    article_id = models.AutoField(Primary_key=True)

  File "C:\Users\cjc\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\models\fields\__init__.py", line 2455, in __init__

    super().__init__(*args, **kwargs)

TypeError: __init__() got an unexpected keyword argument 'Primary_key'


提问者:chujunchao999 2021-06-28 22:17

个回答

  • 喜庆999
    2021-11-27 15:37:27

    primary_key

  • 慕梦前来
    2021-07-04 11:13:54

    在本地上怎么运行起来哦