Hello,

I wrote a middleware[1] for my old blog engine; here, view_func.__module__
is the app’s name. It is not really sophisticated, though, but it may
provide a good start.

About the URL namespace, I don’t think it’s easy to do. An app doesn’t have
a namespace; you can include an url definition file multiple times with
different namespaces.

Best,
Gergely

[1]
https://github.com/gergelypolonkai/gergelypolonkaiweb/blob/master/gergelypolonkaiweb/middleware/viewname.py

2015-05-08 18:11 GMT+02:00 David <cthl...@gmail.com>:

> Hi
>
> Sorry if this is confusing, it's the best I can describe.
>
> I have been separating my templates for inheritance clarity. I have a
> generic template 'category_list.html'. This can be used by different apps
> because the layout is the same.
>
> What I need to do in order to use appropriate links in the template is to
> find out:
>
> a) the name of the application calling it
> b) the namespace of the application url so I can use a dynamic {% url %}
> tag
>
> Firstly, I guess, is this possible?
>
> Yes, I can inherit the templates further and pass info directly from the
> views, but the creation of extra templates just for these 2 things seemed
> like I was doing something wrong.
>
> Many thanks for any assistance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/64637401-2cbd-4f8c-b7c0-4910aeceeb84%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/64637401-2cbd-4f8c-b7c0-4910aeceeb84%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACczBU%2B3dakJnzTkHpfdU_BhvEacxABohNb6t0Rv%3DUtXq5aCPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to