GithubHelp home page GithubHelp logo

Can daphne run WSGI apps? about daphne HOT 6 CLOSED

pwtail avatar pwtail commented on June 7, 2024
Can daphne run WSGI apps?

from daphne.

Comments (6)

carltongibson avatar carltongibson commented on June 7, 2024

Out of scope for Daphne.

from daphne.

pwtail avatar pwtail commented on June 7, 2024

This is sabotage!!11

from daphne.

adamchainz avatar adamchainz commented on June 7, 2024

@pwtail don't use such aggressive language. You won't make many internet friends like that.

Daphne has a clear scope - it's an ASGI server. Adding WSGI support would be a lot of coding and maintenance, for little gain, since there are great WSGI servers out there.

from daphne.

pwtail avatar pwtail commented on June 7, 2024

Sorry, I was trying to make a joke)

However, I think, django sees running a single ASGI server as a sound option. As opposed to running both WSGI and ASGI and routing between them.

As I understand, when run under ASGI, a view taking a WSGIRequest, will be auto-adapted, and an ASGIRequest will be passed to it, thus breaking its code. Am I missing something?

from daphne.

adamchainz avatar adamchainz commented on June 7, 2024

As I understand, when run under ASGI, a view taking a WSGIRequest, will be auto-adapted, and an ASGIRequest will be passed to it, thus breaking its code.

"breaking its code" would depend on that code assuming it's passed a WSGIRequest rather than an HttpRequest (the base class). The latter is all that Django promises. I'm not sure there are many noticeable differences in WSGIRequest anyway? Have you got an example of a crash?

from daphne.

pwtail avatar pwtail commented on June 7, 2024

Thank you @adamchainz for your questions, I've been able to figure that out. django has all the logic in place for this, it just doesn't "export" the API. It is relatively easy to make this functionality public as a some kind of ASGI-to-WSGI adapter, just nobody seems to be interested in that.

In other words, django contains the code equivalent to this package for example https://github.com/etianen/aiohttp-wsgi. It just keeps it private

from daphne.

Related Issues (20)

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.