InnoDB: Log scan progressed past the checkpoint lsn 377750615222 InnoDB: The log sequence numberin ibdata files does not match InnoDB: thelog sequence numberinthe ib_logfiles! InnoDB: Database was not shut down normally!
之后想到一个办法是重建数据库,也就是将SQL全部导出,之后再重新导入。在使用mysqldump导出数据时,老是提示mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table, 原因还是数据库重启了。
发现program配置里有directory这个选项,目的是在启动程序时,让程序进入的目录。例如在使用gunicorn启动Django项目时,如果wsgi指定的路径使用/隔开,则会报importerror import by filename is not supported, 配置directory为wsgi所在的目录,问题就得到解决。
classIsOwnerOrReadOnly(permissions.BasePermission): """ Object-level permission to only allow owners of an object to edit it. Assumes the model instance has an `owner` attribute. """
defhas_object_permission(self, request, view, obj): # Read permissions are allowed to any request, # so we'll always allow GET, HEAD or OPTIONS requests. if request.method in permissions.SAFE_METHODS: returnTrue
# Instance must have an attribute named `owner`. return obj.owner == request.user