+1 - thanks to Ronny, Bruno and Daniel's advice in this thread.  It helps
sometimes to have pointers to info/tools in the context of a problem, even
if I was vaguely aware of the info/tools before.

On Thu, Oct 16, 2008 at 4:30 AM, Israel Dacanay Canasa <[EMAIL PROTECTED]>wrote:

>
> Bruno,
>
> Thanks a lot!
>
> I didn't know that Django will include the templatetags of all apps
> mentioned in settings.py. I thought that templatetags are included
> only within the context of the current app accessed by the browser.
>
> Now everything looks clearer, and I feel that I just got out from
> being a newbie, because this information gave me an idea on how to do
> almost all the things that I want for my project.
>
> Thank you so much!
>
> Israel Dacanay Canasa
> ---------------------------------
> Email: [EMAIL PROTECTED]
> Cel #: +63917-404-8030
> Phone #: +632-567-2635
>
> On 10 16, 08, at 7:12 PM, bruno desthuilliers wrote:
>
> >
> > On 16 oct, 12:34, raeldc <[EMAIL PROTECTED]> wrote:
> >> Hello Again Guys!
> >>
> >> With your guidance, I was able to get a pretty good idea on how to
> >> put
> >> mini-content boxes on my website.
> >>
> >> However, one thing I realized (with my still limited understanding of
> >> Django), is that templatetags are actually coupled with apps. To
> >> create templatetags, I must make it as a templatetags module inside
> >> my
> >> apps. It doesn't look "loosely coupled" to me if I want to reuse the
> >> same templatetag on different apps.
> >
> > It's just like for any function/class/whatever you want to make
> > reusable in different contexts : put it in a separate package /
> > module / app.
> >
> > Since indeed Django requires templatetags to live in a "django
> > application" - that is, a python package with a more or less defined
> > layout -, then the solution is obvious:
> >
> > - start a new 'mycustomtags' app
> > - move your templatetags to this app
> > - put that app somewhere in your PYTHONPATH (apps don't have to live
> > in your project, cf django.contrib.XXX apps)
> > - and of course mention that app in your project
> > settings.INSTALLED_APPS
> >
> > Note that just any 'component' of a django app is optional. IOW, you
> > don't have to have models AND views AND urls AND whatnot - just put
> > what makes sense. In your case, your mycustomtemplatetags app layout
> > would only contain the mandatory[1] top-level __init__.py, the
> > templatetags directory - with it's own mandatory __init__.py -, and
> > your templatetags file(s). FWIW, that's just what the template_utils
> > app do:
> > http://code.google.com/p/django-template-utils/
> >
> > 1] mandatory to make Python consider this directory as a Python
> > package.
> >
> > HTH
> >
> >
> > >
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to