Hi Eugene,
The way to do this is to make another project (just a module with an
__init__.py inside) and then have a templatetags module inside that... Your
directory structure looks like this:
top_module/
-> __init__.py
-> templatetags/
-> __init__.py
-> some_file.py
Put all of your templatetags in some_file.py and include top_module in your
installed apps. In your templates you just
{% load some_file %}
AFAIK that's all you need.
Cheers
Ben
On 04/07/07, Eugene Morozov <[EMAIL PROTECTED]> wrote:
>
>
> Hello,
> I have two projects, they were developed independently. They will be
> run on the same server and have many things in common (notably some
> models and templatetags).
>
> While I can import models from another project if it is on PYTHONPATH,
> I cannot find a way to share templatetags. I don't want to copy them,
> because maintaining costs would become higher (need to remember to
> apply bug fixes in both places, for example).
>
> Is there a way to import templatetags from another project?
>
> Django is really great framework, but I have a gut feeling that Django
> support for code reuse is significantly worse, than, say, in Plone/
> Zope 3. Though it might be because of my relative inexpirience in
> Django.
>
> I would be very grateful if someone will point me to pages/blog
> entries about how to write Django apps with reusability in mind.
> Eugene
>
>
> >
>
--
Regards,
Ben Ford
[EMAIL PROTECTED]
+628111880346
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---