4 ms·
I think requests and werkzeug are great, but I'm not entirely sure what problems this proposal addresses. First, it will be extremely hard to get Django to rep
by zeeg 15y ago
I think requests and werkzeug are great, but I'm not entirely sure what problems this proposal addresses.
First, it will be extremely hard to get Django to replace a large chunk of it's core with an external library. Not only because they don't rely on an external dependencies, but because there's no obvious benefit.
For example, why would you replace the Django test client with something resembling requests? There's no need to go through the entire request process cycle just to test a small chunk of code. It makes them less efficient, less accurate, and more difficult to understand when something goes wrong.
Second, things like "cachecore" are not synonymous with "http caching", and are extremely confusing names. I think that "uricore" is a good idea, but it's another non-obvious name. It's not a "core" at all, but rather an improved version of urlparse.
I think there are a lot of valuable uses that can come from separating common functionality out so it can be reused in various places, but I dont think Python users are concerned about HTTP not mapping 1:1 with WSGI day-to-day. I can definitely say I'm not, and I'd like to think I have some knowledge as to what matters in [Python] web development.
- Wraithan 15y agoWell I think the replacement in django's tests wouldn't be for general unit tests but instead to replace their tests client that one can use to test your own views.
- zeeg 15y agoThats exactly what I was talking about. Why would you even consider replacing the test client? What value could it possibly bring? There's no need to test the HTTP lifecycle when you're performing simple "heres the data for my view, execute it, and return the response to me". The http client itself should be tested, as well as Django's internals. It should be clear and obvious separation of concerns.
- kenneth_reitz 15y agoDon't focus too much on the notion of the Django stuff — it's just vaguely mentioned as worth exploring at the bottom of the post. Luckily, all of these changes will be purely non-destructive refactoring and won't have any negative effects.
- the_cat_kittles 15y ago"Luckily, all of these changes will be purely non-destructive and won't have any negative effects" That sounds like what economists like to call a "pareto improvement", always a good thing :)
- jMyles 15y ago...of course, the introduction of LiveServerTestCase in django 1.4 puts another twist in this discussion - and a pretty awesome one, if I may say. The possibilities for testing the request / response cycle with varying levels of comprehension and veracity have never looked so sweet.
- sunsu 15y agoI agree. While I think its great that key members in the python community are making sure key projects work together, I can't say that this will affect how I do things day to day in the short term. In the longer term, I'm sure this interoperability will pay bigger dividends, which I'm sure is the reason behind all this anyway.
- kenneth_reitz 15y agoExactly.