Mike Malone wrote: > Well, not really. It's making a way to generate a URL based on the > request object global. I agree that it's not ideal, but it's not the > same as just making the request object global.
My main gripe is not globalness of a request object itself (I agree with "not ideal" here) but the very idea of constructing a URL from request. > You wouldn't have any trouble in a standalone script unless you tried > to call the get_absolute_url() function. But I kinda want that. Here's two more usecases where using current request for creating URLs is broken: - If I have an API part of the service and human-readable part of the service on different hosts and I want to construct a reference to API when serving user pages. - If have several machines behind a load-balancing proxy that's not under my control and that's not telling me its hostname I don't want to construct URLs with internal hostnames of individual machines in cluster. In other words there are legitimate real-world cases when "current" requests has nothing to do the URL I want to cnstruct. > I will reiterate that, in practice, this is a huge pain in the ass. Can you provide an example? My experience doesn't match this. My only minor complaint is that I sometimes forget to update default "example.com" generated for Site model on new installation (which should be fixed differently, IMO). -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.