> Voila, I now have created an app that is independent of it's
> surrounding project.  The only thing left is the fact that my app has
> templates, which I understand is a no-no when making reusable apps.
> I'll start working on that later, as I'm satisfied now with no strict
> backwards dependencies.

It's not an absolute no-no. View templates are pretty pointless,
because markup, page structure, CSS hooks, template {% block %}s etc.
differ so widely. However, small inclusion tags, if "atomic" enough,
may benefit from some default templates. If you want a default
template in your reusable app, structure it thusly:

myapp
    /templates
        /myapp
            my_tag.html
    /templatetags
        myapp_tags.py

And refer to it simply as "myapp/my_tag.html". That way, the consumer
of your app can override it by having a "myapp/my_tag.html" of their
own in their project's templates directory.

Regards
Scott

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

Reply via email to