Ok I see better.
Talking about efficiency, I take this opportunity to link here the 
following draft PR I made: Backtracking URL Resolver 
<https://github.com/django/django/pull/14343> and Provide ability to abort 
URL resolution early <https://github.com/django/django/pull/14342>, which, 
if implemented in the right way, may help make URL resolving more efficient 
and more flexible too.

I understand that you may not have time to review  or maybe this is not 
something you are planning to put into Django right now, but I would be 
very happy to have any feedback on it!

Le mercredi 5 mai 2021 à 17:19:43 UTC+2, f.apo...@gmail.com a écrit :

> On Thursday, April 29, 2021 at 4:23:57 PM UTC+2 atd...@gmail.com wrote:
>
>> In both cases however, the current check being done in the 
>> process_response method for the CommonMiddleware(here 
>> <https://github.com/django/django/blob/4ab3ef238edfa7c7b7c2c4420c7ae5b722bde121/django/middleware/common.py#L105-L108>)
>>  
>> seems irrelevant to me unless I am missing *something*. 
>>
>
> You are most likely not missing anything and we also noticed that when 
> fixing the admin enumeration stuff. But we did not get around to fixing it 
> yet. That said, I think doing this in process_response would be preferable 
> over doing it in process_request so the extra checks when the URL is valid 
> (the common case) are reduced. Resolving URLs can take a bit, especially 
> when the urlconf is long and as such I'd like to get that check out of the 
> "hot" code path. Only doing the redirect in the case of a failing resolve 
> in the first place would probably make this more efficient.
>
> Cheers,
> Florian
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/0608b103-4fee-4d10-8af4-e21f654cdaa9n%40googlegroups.com.
  • APP... Tidiane Dia
    • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
      • ... Tidiane Dia
        • ... Tidiane Dia
    • ... Florian Apolloner
      • ... Tidiane Dia
        • ... Florian Apolloner
          • ... Tidiane Dia
            • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
              • ... Florian Apolloner
          • ... chris.j...@gmail.com
            • ... Florian Apolloner
              • ... 'Adam Johnson' via Django developers (Contributions to Django itself)

Reply via email to