GithubHelp home page GithubHelp logo

Comments (5)

andrewgodwin avatar andrewgodwin commented on July 24, 2024

Well, request.environ is not part of the public Request API so I was trying not to provide it (for example, a test client request isn't a WSGIRequest either). Why do you need it? All the things it provides appear in META, pretty much.

from channels.

bastianh avatar bastianh commented on July 24, 2024

The library I'm using is using it, I guess it's also possible to change that or use my own but I wasn't sure if that's the only difference.

https://github.com/jrief/django-angular/blob/master/djangular/middleware.py

from channels.

andrewgodwin avatar andrewgodwin commented on July 24, 2024

Yeah, that library is using undocumented features; they're manually rebuilding requests, which just isn't going to integrate with Channels very well. There's not much I can do to support that yet, really; hopefully once we have a clear outline of how requests will differ in a non-WSGI environment I can contribute pull requests to projects like these to help them use things via documented APIs.

For what it's worth, I don't know why they don't mutate the Request object on the fly like other middlewares do, but there might be a good reason for it.

from channels.

knbk avatar knbk commented on July 24, 2024

request.META is the same dict (not just a copy, but the same object) as request.environ. Any app that uses request.environ can switch to request.META without any issues.

from channels.

andrewgodwin avatar andrewgodwin commented on July 24, 2024

Right; there's no need for .environ at all, from what I understand.

from channels.

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.