Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les fondamentaux
Voir le programme détaillé
Classe « View »

Méthode flask.views.View.as_view

Signature de la méthode as_view

def as_view(name: 'str', *class_args: 't.Any', **class_kwargs: 't.Any') -> 'ft.RouteCallable' 

Description

help(View.as_view)

Convert the class into a view function that can be registered
for a route.

By default, the generated view will create a new instance of the
view class for every request and call its
:meth:`dispatch_request` method. If the view class sets
:attr:`init_every_request` to ``False``, the same instance will
be used for every request.

Except for ``name``, all other arguments passed to this method
are forwarded to the view class ``__init__`` method.

.. versionchanged:: 2.2
    Added the ``init_every_request`` class attribute.


Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les compléments
Voir le programme détaillé