Fixed #21587 -- Raised deprecation warnings correctly.

why is this method needed? It seems redundant since `View.as_view()` calls `__init__()`.