mirror of
https://github.com/django/daphne.git
synced 2025-07-10 16:02:18 +03:00
Updating Channels status regarding inclusion into django core (#424)
* Updating Channels status regarding django inclusion * Removing the page regarding Cross-Compatibility and the references to it.
This commit is contained in:
parent
6c471ef915
commit
8682e83fd1
|
@ -1,44 +0,0 @@
|
|||
Cross-Compatibility
|
||||
===================
|
||||
|
||||
Channels is being released as both a third-party app for Django 1.8 through 1.10,
|
||||
and being integrated into Django in future. Both of these implementations will be
|
||||
very similar, and code for one will work on the other with minimal changes.
|
||||
|
||||
The only difference between the two is the import paths. Mostly, where you
|
||||
imported from ``channels`` for the third-party app, you instead import from
|
||||
``django.channels`` for the built-in solution.
|
||||
|
||||
For example::
|
||||
|
||||
from channels import Channel
|
||||
from channels.auth import channel_session_user
|
||||
|
||||
Becomes::
|
||||
|
||||
from django.channels import Channel
|
||||
from django.channels.auth import channel_session_user
|
||||
|
||||
There are a few exceptions to this rule, where classes will be moved to other parts
|
||||
of Django in that make more sense:
|
||||
|
||||
* ``channels.tests.ChannelTestCase`` is found under ``django.test.channels.ChannelTestCase``
|
||||
* ``channels.handler`` is moved to ``django.core.handlers.asgi``
|
||||
* ``channels.staticfiles`` is moved to ``django.contrib.staticfiles.consumers``
|
||||
* The ``runserver`` and ``runworker`` commands are in ``django.core.management.commands``
|
||||
|
||||
|
||||
Writing third-party apps against Channels
|
||||
-----------------------------------------
|
||||
|
||||
If you're writing a third-party app that is designed to work with both the
|
||||
``channels`` third-party app as well as ``django.channels``, we suggest you use
|
||||
a try-except pattern for imports, like this::
|
||||
|
||||
try:
|
||||
from django.channels import Channel
|
||||
except ImportError:
|
||||
from channels import Channel
|
||||
|
||||
All the objects in both versions act the same way, they simply are located
|
||||
on different import paths. There should be no need to change logic.
|
|
@ -51,7 +51,6 @@ Topics
|
|||
binding
|
||||
backends
|
||||
testing
|
||||
cross-compat
|
||||
reference
|
||||
faqs
|
||||
asgi
|
||||
|
|
|
@ -94,9 +94,16 @@ affect the overall deployed site.
|
|||
What version of Django does it work with?
|
||||
-----------------------------------------
|
||||
|
||||
You can install Channels as a library for Django 1.8 and 1.9, and it (should be)
|
||||
part of Django 1.10. It has a few extra dependencies, but these will all
|
||||
be installed if you use ``pip``.
|
||||
You can install Channels as a library for Django >= 1.8. It has a few
|
||||
extra dependencies, but these will all be installed if you use ``pip``.
|
||||
|
||||
Official project
|
||||
----------------
|
||||
|
||||
Channels is not in the Django core as it was initially planned, but it's
|
||||
an official Django project since september 2016. More informations about Channels
|
||||
as an official project are available on the
|
||||
`Django blog <https://www.djangoproject.com/weblog/2016/sep/09/channels-adopted-official-django-project/>`_.
|
||||
|
||||
|
||||
What do I read next?
|
||||
|
|
Loading…
Reference in New Issue
Block a user