-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ASGI cookbook recipe #198
ASGI cookbook recipe #198
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! This looks good. I made a few suggestions.
docs/deployment/asgi.rst
Outdated
ASGI (Asynchronous Server Gateway Interface) | ||
++++++++++++++++++++++++++++++++++++++++++++ | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove 1 extra blank line.
Note, it's OK to have two blank lines preceding a heading because it helps visually separate the narrative from the subsequent heading. Next it's good to have the heading visually "connect" with its narrative content.
docs/deployment/asgi.rst
Outdated
|
||
|
||
This chapter contains information about using ASGI with | ||
Pyramid. You can read more about the specification here: https://github.com/django/asgiref/blob/master/specs/asgi.rst. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you consider publishing to Read the Docs? GitHub's rendering of reStructuredText is suboptimal. I can assist with PRs to your repo, if you like, but you'd need to configure GitHub and RTD under your own account.
docs/deployment/asgi.rst
Outdated
This chapter contains information about using ASGI with | ||
Pyramid. You can read more about the specification here: https://github.com/django/asgiref/blob/master/specs/asgi.rst. | ||
|
||
The example app below uses the WSGI to ASGI wrapper from the `asgiref` library to transform normal WSGI requests into ASGI responses - this allows the application to be run with an ASGI server, `uvicorn` or `daphne`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reStructuredText uses double-ticks for inline literals, single-ticks for italics/emphasis. If literals are your intent, then change them throughout, for example:
``asgiref``
However, when first mentioned in a narrative, it is a good idea to include links to references. Suggest for the first instance of each turning these into links, with subsequent mentions as inline literals.
`asgiref <https://pypi.org/project/asgiref/>`_
This is two sentences. "responses. This"
Finally:
server, including `uvicorn <http://www.uvicorn.org/>`_ or `daphne <https://pypi.org/project/daphne/>`_.
Note, choosing appropriate URLs for a project depends on context. Here the context is docs. Unfortunately there are no ReadTheDocs URLs for these projects, so I picked the one that appears to best represent the project, with PyPI as the default. If you have better URLs, please use them instead.
docs/deployment/asgi.rst
Outdated
Simple WSGI -> ASGI WebSocket application | ||
----------------------------------------- | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove 1 extra blank line.
docs/deployment/asgi.rst
Outdated
$ daphne app:app | ||
|
||
|
||
There are several potential deployment options, one example is `nginx` and `supervisor`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`nginx <https://nginx.org/>`_ and `supervisor <http://supervisord.org/>`_.
Thanks for the quick feedback :) I'll have a think about how I should go about hosting the documentation and then update the PR based on your suggestions. |
Thank you! |
Refers to Pylons/pyramid#2603.
This provides an example ASGI WebSocket app using Pyramid. It also contains example deployment configurations for nginx and supervisor.