# Django Channels (Django) > WebSockets, ASGI, consumers, routing, channel layers, authentication, real-time features - 24 questions d'entretien - Senior - [Questions d'entretien: Django](https://sharpskill.dev/fr/technologies/django/questions-entretien.md) ## 1. Qu'est-ce que Django Channels ? **Réponse** Django Channels est une extension qui ajoute le support des protocoles asynchrones à Django, permettant de gérer WebSockets, HTTP2 et d'autres protocoles non-HTTP. Il étend le modèle requête-réponse synchrone de Django en utilisant ASGI (Asynchronous Server Gateway Interface) au lieu de WSGI, permettant ainsi des fonctionnalités temps réel comme le chat ou les notifications push. ## 2. Quelle est la différence principale entre WSGI et ASGI ? **Réponse** WSGI (Web Server Gateway Interface) est synchrone et ne gère qu'une requête à la fois par worker, tandis qu'ASGI (Asynchronous Server Gateway Interface) supporte les opérations asynchrones et les connexions persistantes comme WebSockets. ASGI peut gérer plusieurs connexions simultanément sans bloquer, ce qui est essentiel pour les applications temps réel. ## 3. Qu'est-ce qu'un Consumer dans Django Channels ? **Réponse** Un Consumer est l'équivalent d'une vue Django pour les connexions asynchrones. Il gère le cycle de vie complet d'une connexion WebSocket : connexion, réception de messages, envoi de réponses et déconnexion. Les Consumers peuvent être synchrones (WebsocketConsumer) ou asynchrones (AsyncWebsocketConsumer) et permettent de structurer la logique métier pour chaque type de connexion. ## 21 questions supplémentaires disponibles - Quelle méthode d'un Consumer est appelée lors de l'établissement d'une connexion WebSocket ? - Qu'est-ce que le scope dans Django Channels ? S'inscrire gratuitement: https://sharpskill.dev/fr/login ## Autres sujets d'entretien Django - [Les bases de Python](https://sharpskill.dev/fr/technologies/django/questions-entretien/python-basics.md): 25 questions, Junior - [Python orienté objet](https://sharpskill.dev/fr/technologies/django/questions-entretien/python-oop.md): 20 questions, Junior - [Fondamentaux Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-fundamentals.md): 20 questions, Junior - [Models Django - Bases](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-models-basics.md): 22 questions, Junior - [Vues Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-views.md): 20 questions, Junior - [Templates Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-templates.md): 18 questions, Junior - [Formulaires Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-forms.md): 22 questions, Confirmé - [QuerySets avancés](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-querysets.md): 25 questions, Confirmé - [Authentification Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-authentication.md): 22 questions, Confirmé - [Middleware Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-middleware.md): 18 questions, Confirmé - [Admin Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-admin.md): 20 questions, Confirmé - [Django REST Framework](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-rest-framework.md): 30 questions, Confirmé - [Signaux Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-signals.md): 18 questions, Confirmé - [Upload de fichiers](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-file-upload.md): 20 questions, Confirmé - [Cache Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-caching.md): 20 questions, Confirmé - [Sessions Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-sessions.md): 18 questions, Confirmé - [Email Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-email.md): 18 questions, Confirmé - [Tests Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-testing.md): 22 questions, Confirmé - [Sécurité Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-security.md): 22 questions, Confirmé - [Déploiement Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-deployment.md): 24 questions, Confirmé - [ORM Django avancé](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-orm-advanced.md): 28 questions, Senior - [Performance Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-performance.md): 24 questions, Senior - [Django & Celery](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-celery.md): 22 questions, Senior - [Django & GraphQL](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-graphql.md): 24 questions, Senior - [Django & Docker](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-docker.md): 20 questions, Senior - [Django dans un écosystème Microservices](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-microservices.md): 24 questions, Senior - [Commandes Django personnalisées](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-custom-commands.md): 18 questions, Senior - [Internationalisation Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-internationalization.md): 20 questions, Senior - [Design Patterns Django](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-design-patterns.md): 24 questions, Senior - [Django Async & ASGI](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-async-asgi.md): 26 questions, Senior - [Settings & Configuration Production](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-settings-configuration.md): 22 questions, Senior - [Observabilité & Monitoring](https://sharpskill.dev/fr/technologies/django/questions-entretien/django-observability.md): 24 questions, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/fr/technologies/django/questions-entretien/django-channels