Django admin' Post'对象没有属性'发布'

时间:2017-12-01 22:52:21

标签: python django nanoboxio

我想用django

创建admin后端

模块/博客/ admin.py

from django.contrib import admin
from .models import Post

# Register your models here.
admin.site.register(Post)

我点击SAVE

时添加新的博文内容除外
AttributeError at /admin/blog/post/add/
'Post' object has no attribute 'publish'
Request Method: POST
Request URL:    http://ilkblog.dev:8000/admin/blog/post/add/
Django Version: 1.11.7
Exception Type: AttributeError
Exception Value:    
'Post' object has no attribute 'publish'
Exception Location: /data/lib/python3.6/site-packages/django/db/models/base.py in _perform_date_checks, line 1146
Python Executable:  /data/bin/python
Python Version: 3.6.3
Python Path:    
['/app/app',
 '/data/lib/python36.zip',
 '/data/lib/python3.6',
 '/data/lib/python3.6/lib-dynload',
 '/data/lib/python3.6/site-packages']
Server time:    Fri, 1 Dec 2017 22:36:08 +0000

0 个答案:

没有答案