I don't think there's an "architecture rule" that would prevent that 
design. It looks like DISALLOWED_USER_AGENTS has been around since 2005, 
but handler403 wasn't added until 1.4. Since the docs for the setting say 
"Use this for bad robots/crawlers." I guess it's implied that customizing 
the response isn't particularly useful. You could try writing a patch with 
your suggested approach and see if you run into any issues. I guess it 
might be a bit slower performance-wise.

On Tuesday, June 23, 2015 at 8:25:56 AM UTC-4, François Schiettecatte wrote:
>
> What about the 403 handler ? 
>
>         https://docs.djangoproject.com/en/1.8/ref/urls/#handler403 
>
> François 
>
> > On Jun 23, 2015, at 8:10 AM, [email protected] <javascript:> wrote: 
> > 
> > Dear, folks! 
> > 
> > I wonder is there some architecture rule that doesn't allow 
> CommonMiddleware raise PermissionDenied exception? 
> > 
> > Right now if django-developer wants to use DISALLOWED_USER_AGENTS 
> setting than all disallowed clients get empty page with simple header 
> "Forbidden". 
> > And there is no way to change this behavior (except wright your own 
> middleware class of cause). 
> > 
> > Thanks! 
> > 
> > -- 
> > Mikhail Nacharov 
> > 
> > -- 
> > 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 [email protected] <javascript:>. 
> > To post to this group, send email to [email protected] 
> <javascript:>. 
> > Visit this group at http://groups.google.com/group/django-developers. 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/f43d50ac-8d79-4a14-a71b-d468902779ec%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/a7073a8b-7205-4e4c-b889-f9548048f871%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to