Giter Club home page Giter Club logo

Comments (3)

etianen avatar etianen commented on August 18, 2024

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 Gunicorn

Let 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.

imdaveho avatar imdaveho commented on August 18, 2024

@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.

etianen avatar etianen commented on August 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.