Comments (3)
There's no point running asyncio behind waitress, as waitress is only for
serving sync requests. asyncio is all about the async requests.
The quickest way to get started with aiohttp-wsgi is the serve() method:
https://github.com/etianen/aiohttp-wsgi#serveapplication-kwargs
The example code provided is all you need to start an async server running
your Django app. However, at this point, you're no better off than
waitress, since all your requests will be served synchronously by Django.
The point of aiohttp-wsgi is that is allows a Django application to share
the same port and router as an aiohttp application. That is, you can write
the vast majority of your code as a simple Django application, with the
bare minimum of async stuff living inside one or more aiohttp views.
On Wed, 23 Dec 2015 at 00:03 Dave Ho [email protected] wrote:
Just wondering if there are any caveats/instructions to deployment? (eg in
my case, I'm hoping to set up a quick development server with Heroku and
wondering if I can use this wrapper with waitress) I'm assuming no, since
aiohttp has it's own http serverbut I know there is support for aiohttp
with GunicornLet me know if this makes sense I'm sure I may not be making the most
sense as I'm just getting started with asyncioand trying to make it work
with Django—
Reply to this email directly or view it on GitHub
#6.
from aiohttp-wsgi.
@etianen Ahhh, I get it. The application is really Django + aiohttp.web app bundled together.
I'm new to the async world, so forgive my ignorance: to create a update pushing service like Trello or Google docs, for only a portion of the application, in which each user can collaborate in real-time, I'm thinking of using Django + asyncio + websockets + Redis (as described here, but with native asyncio in Python 3 instead of gevent)
Is it "better" to implement it that way or use this two framework bundled approach? Since I'm only trying to implement an asynchronous loop for a websocket connection only in a few sections of the application, would the above make more sense?
This probably is better left for a StackOverflow, but since you're here... If you want to just close this thread that's fine too; I understand that this isn't related to deployment or this library. Thanks for the responses thus far! Cheers.
from aiohttp-wsgi.
In your case, I'd write the majority of the app in Django, since it's a
great way to get the app working.
I'd then write the async parts using aiohttp websockets.
You can then glue the two parts together using aiohttp-wsgi!
On Wed, 23 Dec 2015 at 13:27 Dave Ho [email protected] wrote:
@etianen https://github.com/etianen Ahhh, I get it. The application is
really Django + aiohttp.web app bundled together.I'm new to the async world, so forgive my ignorance: to create a update
pushing service like Trello or Google docs, for only a portion of the
application, in which each user can collaborate in real-time, I'm thinking
of using Django + asyncio + websockets + Redis (as described here
https://django-websocket-redis.readthedocs.org/en/latest/introduction.html#uwsgi,
but with native asyncio in Python 3 instead of gevent)Is it "better" to implement it that way or use this two framework bundled
approach? Since I'm only trying to implement an asynchronous loop for a
websocket connection only in a few sections of the application, would the
above make more sense?This probably is better left for a StackOverflow, but since you're here...
If you want to just close this thread that's fine too; I understand that
this isn't related to deployment or this library. Thanks for the responses
thus far! Cheers.—
Reply to this email directly or view it on GitHub
#6 (comment).
from aiohttp-wsgi.
Related Issues (18)
- What's the benefit for aiohttp-wsgi + django? HOT 2
- aiohttp-wsgi on heroku HOT 5
- [Django] bug with cyrillic chars in URL HOT 3
- Need a version compatible with aiohttp>=2 HOT 2
- Serving WSGI app from Python code HOT 6
- Option to instruct aiohttp-wsgi to not touch logging HOT 3
- Update to aiohttp 3+ HOT 2
- Runtime error using Django HOT 1
- Flask + ProcessPoolExecutor -> TypeError: can't pickle _thread.lock objects HOT 2
- Version of Python HOT 1
- TypeError: handle_request() takes 2 positional arguments but 3 were given HOT 2
- EnvironTest.testEnviron fails with aiohttp 3.8.1 HOT 2
- "socket.send() raised exception." HOT 7
- Improper "unquoting" HOT 2
- Memory exhaustion for large request. HOT 4
- Please provide support for aiohttp 0.22 HOT 2
- Running under multiple processes? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiohttp-wsgi.