Django-ification

This commit is contained in:
Andrew Godwin 2016-09-09 13:29:12 +01:00
parent 21f0aeaf64
commit 971d3fc8d0
11 changed files with 69 additions and 43 deletions

View File

@ -10,8 +10,10 @@ Examples of contributions include:
* Documentation improvements
* Bug reports and patch reviews
Setup
-----
For more information, please see our `contribution guide <http://channels.readthedocs.io/en/latest/contributing.html>`_.
Quick Setup
-----------
Fork, then clone the repo:
@ -25,9 +27,4 @@ Make your change. Add tests for your change. Make the tests pass:
tox
Push to your fork and `submit a pull request <https://github.com/andrewgodwin/channels/compare/>`_.
At this point you're waiting on us. We like to at least comment on pull requests
within three business days (and, typically, one business day). We may suggest
some changes or improvements or alternatives.
Push to your fork and `submit a pull request <https://github.com/django/channels/compare/>`_.

View File

@ -1,9 +1,9 @@
Django Channels
===============
.. image:: https://api.travis-ci.org/andrewgodwin/channels.svg
:target: https://travis-ci.org/andrewgodwin/channels
.. image:: https://api.travis-ci.org/django/channels.svg
:target: https://travis-ci.org/django/channels
.. image:: https://readthedocs.org/projects/channels/badge/?version=latest
:target: http://channels.readthedocs.org/en/latest/?badge=latest

View File

@ -15,34 +15,46 @@ We're looking for help with the following areas:
* Feature polish and occasional new feature design
* Case studies and writeups
You can find what we're looking to work on right now in two places:
You can find what we're looking to work on in the GitHub issues list for each
of the Channels sub-projects:
* Specific bugs are in the `GitHub issues <https://github.com/andrewgodwin/channels/issues>`_
* Higher-level tasks are on the `ChannelsTasks Django wiki page <https://code.djangoproject.com/wiki/ChannelsTasks>`_
* `Channels issues <https://github.com/django/channels/issues/>`_, for the Django integration
* `Daphne issues <https://github.com/django/daphne/issues/>`_, for the HTTP and Websocket termination
* `asgiref issues <https://github.com/django/asgiref/issues/>`_, for the base ASGI library/memory backend
* `asgi_redis issues <https://github.com/django/asgi_redis/issues/>`_, for the Redis channel backend
* `asgi_ipc issues <https://github.com/django/asgi_ipc/issues/>`_, for the POSIX IPC channel backend
These are, however, just a suggested list - any offer to help is welcome as long
as it fits the project goals.
Issues are categorized by difficulty level:
* ``exp/beginner``: Easy issues suitable for a first-time contributor.
* ``exp/intermediate``: Moderate issues that need skill and a day or two to solve.
* ``exp/advanced``: Difficult issues that require expertise and potentially weeks of work.
I'm interested, how should I get started?
-----------------------------------------
They are also classified by type:
The best thing to do is to see if there's a `GitHub issue <https://github.com/andrewgodwin/channels/issues>`_
for the thing you wish to work on - if there is, leave a comment saying you're
going to take it on, and if not, open one describing what you're doing so there's
a place to record information around.
* ``documentation``: Documentation issues. Pick these if you want to help us by writing docs.
* ``bug``: A bug in existing code. Usually easier for beginners as there's a defined thing to fix.
* ``enhancement``: A new feature for the code; may be a bit more open-ended.
If you have questions, you can either open an issue with the questions detailed,
hop on the ``#django-channels`` channel on Freenode IRC, or email Andrew directly
at ``andrew@aeracode.org``.
You should filter the issues list by the experience level and type of work
you'd like to do, and then if you want to take something on leave a comment
and assign yourself to it. If you want advice about how to take on a bug,
leave a comment asking about it, or pop into the IRC channel at
``#django-channels`` on Freenode and we'll be happy to help.
The issues are also just a suggested list - any offer to help is welcome as long
as it fits the project goals, but you should make an issue for the thing you
wish to do and discuss it first if it's relatively large (but if you just found
a small bug and want to fix it, sending us a pull request straight away is fine).
I'm a novice contributor/developer - can I help?
------------------------------------------------
Of course - just get in touch like above and mention your experience level,
and we'll try the best we can to match you up with someone to mentor you through
the task.
Of course! The issues labelled with ``exp/beginner`` are a perfect place to
get started, as they're usually small and well defined. If you want help with
one of them, pop into the IRC channel at ``#django-channels`` on Freenode or
get in touch with Andrew directly at andrew@aeracode.org.
Can you pay me for my time?

View File

@ -134,7 +134,7 @@ If you want to support WebSockets, long-poll HTTP requests and other Channels
features, you'll need to run a native ASGI interface server, as the WSGI
specification has no support for running these kinds of requests concurrently.
We ship with an interface server that we recommend you use called
`Daphne <http://github.com/andrewgodwin/daphne/>`_; it supports WebSockets,
`Daphne <http://github.com/django/daphne/>`_; it supports WebSockets,
long-poll HTTP requests, HTTP/2 *(soon)* and performs quite well.
You can just keep running your Django code as a WSGI app if you like, behind

View File

@ -17,9 +17,26 @@ WebSockets with only 30 lines of code.
If you want a quick overview, start with :doc:`inshort`.
You can find the Channels repository `on GitHub <http://github.com/andrewgodwin/channels/>`_.
If you are interested in contributing, please read our :doc:`contributing` docs!
Contents:
Projects
--------
Channels is comprised of five packages:
* `Channels <https://github.com/django/channels/>`_, the Django integration layer
* `Daphne <https://github.com/django/daphne/>`_, the HTTP and Websocket termination server
* `asgiref <https://github.com/django/asgiref/>`_, the base ASGI library/memory backend
* `asgi_redis <https://github.com/django/asgi_redis/>`_, the Redis channel backend
* `asgi_ipc <https://github.com/django/asgi_ipc/>`_, the POSIX IPC channel backend
This documentation covers the system as a whole; individual release notes and
instructions can be found in the individual repositories.
Topics
------
.. toctree::
:maxdepth: 2

View File

@ -36,7 +36,7 @@ I have to change how I run Django?
No, all the new stuff is entirely optional. If you want it, however, you'll
change from running Django under a WSGI server, to running:
* An ASGI server, probably `Daphne <http://github.com/andrewgodwin/daphne/>`_
* An ASGI server, probably `Daphne <http://github.com/django/daphne/>`_
* Django worker servers, using ``manage.py runworker``
* Something to route ASGI requests over, like Redis.

View File

@ -28,7 +28,7 @@ To install the latest version of Channels, clone the repo, change to the repo,
change to the repo directory, and pip install it into your current virtual
environment::
$ git clone git@github.com:andrewgodwin/channels.git
$ git clone git@github.com:django/channels.git
$ cd channels
$ <activate your projects virtual environment>
(environment) $ pip install -e . # the dot specifies the current repo

View File

@ -4,9 +4,9 @@ from channels import __version__
setup(
name='channels',
version=__version__,
url='http://github.com/andrewgodwin/channels',
author='Andrew Godwin',
author_email='andrew@aeracode.org',
url='http://github.com/django/channels',
author='Django Software Foundation',
author_email='foundation@djangoproject.com',
description="Brings event-driven capabilities to Django with a channel system. Django 1.8 and up only.",
license='BSD',
packages=find_packages(),

View File

@ -13,10 +13,10 @@ RUN apt-get update && \
# Install asgi_redis driver and most recent Daphne
RUN pip install \
asgi_redis==0.8.3 \
git+https://github.com/andrewgodwin/daphne.git@#egg=daphne
git+https://github.com/django/daphne.git@#egg=daphne
# Clone Channels and install it
RUN git clone https://github.com/andrewgodwin/channels.git /srv/channels/ && \
RUN git clone https://github.com/django/channels.git /srv/channels/ && \
cd /srv/channels && \
git reset --hard caa589ae708a1a66ba1bdcd24f5fd473040772bd && \
python setup.py install

View File

@ -74,7 +74,7 @@ Install fabric on your machine. This is highly dependent on what your environmen
Git clone this project down to your machine::
git clone https://github.com/andrewgodwin/channels/
git clone https://github.com/django/channels/
Relative to where you cloned the directory, move up a couple levels::

View File

@ -13,9 +13,9 @@ def setup_redis():
def setup_channels():
sudo("apt-get update && apt-get install -y git python-dev python-setuptools python-pip")
sudo("pip install -U pip")
sudo("pip install -U asgi_redis asgi_ipc git+https://github.com/andrewgodwin/daphne.git@#egg=daphne")
sudo("pip install -U asgi_redis asgi_ipc git+https://github.com/django/daphne.git@#egg=daphne")
sudo("rm -rf /srv/channels")
sudo("git clone https://github.com/andrewgodwin/channels.git /srv/channels/")
sudo("git clone https://github.com/django/channels.git /srv/channels/")
with cd("/srv/channels/"):
sudo("python setup.py install")
@ -34,7 +34,7 @@ def run_worker(redis_ip):
# Current loadtesting setup
@task
def setup_load_tester(src="https://github.com/andrewgodwin/channels.git"):
def setup_load_tester(src="https://github.com/django/channels.git"):
sudo("apt-get update && apt-get install -y git nodejs && apt-get install npm")
sudo("npm install -g loadtest")
sudo("ln -s /usr/bin/nodejs /usr/bin/node")
@ -59,7 +59,7 @@ def setup_tester():
sudo("apt-get update && apt-get install -y apache2-utils python3-pip")
sudo("pip3 -U pip autobahn twisted")
sudo("rm -rf /srv/channels")
sudo("git clone https://github.com/andrewgodwin/channels.git /srv/channels/")
sudo("git clone https://github.com/django/channels.git /srv/channels/")
@task