decorating an include in urls.py

199 views
Skip to first unread message

Gelonida N

unread,
Jul 6, 2012, 5:25:24 AM7/6/12
to django...@googlegroups.com
I'd like to decorate all views in an include.

Let's take for example:

urlpatterns = patterns('',
url(r'^decorated_admin/', include(admin.site.urls)),
)


Is there any way to decorate all views in admin.site.urls

I was looking for a syntax similiar to:

urlpatterns = patterns('',
url(r'^webfw/admin/', include_and_decorate(admin.site.urls,
mydecorator)),
)




One use case would be for example to add authentification or specific
logging to an entire list of views.


Thanks in advance for any suggestions.

Alexandr Aibulatov

unread,
Jul 6, 2012, 6:32:24 AM7/6/12
to django...@googlegroups.com
Try to use this library https://github.com/jeffkistler/django-decorator-include

2012/7/6 Gelonida N <gelo...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
Reply all
Reply to author
Forward
0 new messages