Django-使用现代中间件,我是否应该使用process_view?

问题描述

我正在使用Django 3.1将一些中间件迁移到新的Django代码库。 我显然使用的是020-09-14T15:00:32.411104974Z: [ERROR] Caused by: com.MysqL.jdbc.exceptions.jdbc4.MysqLNonTransientConnectionException: Got packets out of order 2020-09-14T15:00:32.411109175Z: [ERROR] at sun.reflect.GeneratedConstructorAccessor39.newInstance(UnkNown Source) 2020-09-14T15:00:32.411119776Z: [ERROR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 2020-09-14T15:00:32.411123976Z: [ERROR] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 2020-09-14T15:00:32.411127976Z: [ERROR] at com.MysqL.jdbc.Util.handleNewInstance(Util.java:411) 2020-09-14T15:00:32.411131977Z: [ERROR] at com.MysqL.jdbc.Util.getInstance(Util.java:386) 2020-09-14T15:00:32.411135977Z: [ERROR] at com.MysqL.jdbc.sqlError.createsqlException(sqlError.java:1013) 2020-09-14T15:00:32.411140077Z: [ERROR] at com.MysqL.jdbc.MysqLIO.checkerrorPacket(MysqLIO.java:3609) 2020-09-14T15:00:32.411144077Z: [ERROR] at com.MysqL.jdbc.MysqLIO.checkerrorPacket(MysqLIO.java:3541) 2020-09-14T15:00:32.411148078Z: [ERROR] at com.MysqL.jdbc.MysqLIO.sendCommand(MysqLIO.java:2002) 2020-09-14T15:00:32.411152078Z: [ERROR] at com.MysqL.jdbc.MysqLIO.sqlQueryDirect(MysqLIO.java:2163) 2020-09-14T15:00:32.411156178Z: [ERROR] at com.MysqL.jdbc.ConnectionImpl.execsql(ConnectionImpl.java:2618) 2020-09-14T15:00:32.411160379Z: [ERROR] at com.MysqL.jdbc.ConnectionImpl.execsql(ConnectionImpl.java:2568) 2020-09-14T15:00:32.411164379Z: [ERROR] at com.MysqL.jdbc.StatementImpl.executeQuery(StatementImpl.java:1557) 2020-09-14T15:00:32.411168379Z: [ERROR] at com.MysqL.jdbc.ConnectionImpl.loadServerVariables(ConnectionImpl.java:3868) 2020-09-14T15:00:32.411172480Z: [ERROR] at com.MysqL.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3407) 2020-09-14T15:00:32.411179480Z: [ERROR] at com.MysqL.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2384) 2020-09-14T15:00:32.411183580Z: [ERROR] at com.MysqL.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2153) 2020-09-14T15:00:32.411187681Z: [ERROR] at com.MysqL.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:792) 2020-09-14T15:00:32.411191981Z: [ERROR] at com.MysqL.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) 2020-09-14T15:00:32.411196181Z: [ERROR] at sun.reflect.GeneratedConstructorAccessor36.newInstance(UnkNown Source) 2020-09-14T15:00:32.411200282Z: [ERROR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 2020-09-14T15:00:32.411204382Z: [ERROR] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 2020-09-14T15:00:32.411208482Z: [ERROR] at com.MysqL.jdbc.Util.handleNewInstance(Util.java:411) 2020-09-14T15:00:32.411212483Z: [ERROR] at com.MysqL.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381) 2020-09-14T15:00:32.411216483Z: [ERROR] at com.MysqL.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305) 2020-09-14T15:00:32.411220583Z: [ERROR] at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38) 2020-09-14T15:00:32.411224684Z: [ERROR] at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582) 2020-09-14T15:00:32.411228784Z: [ERROR] at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556) 2020-09-14T15:00:32.411232884Z: [ERROR] at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545) 2020-09-14T15:00:32.411237085Z: [ERROR] ... 32 more ,而不是MIDDLEWARE

我看到MIDDLEWARE_CLASSES仍受支持。但是我不明白为什么要使用它。它是否可以直接通过使用process_view的标准中间件添加任何东西?

在此流程中何时甚至会调用get_response

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)