Hallöchen! Johan writes:
> Thanks for all the feedback. By nature I prefer NOT to use a to > deep framework stack. So although django-harness could work I > would prefer to keep my dependencies simple. I would probably go > with managing the python path. It seems to be the simplest way and > most transparent way of handling the situation. I think so, too. I did some research on this two weeks ago and my impression was that there are no guidelines at all to create portable apps. On the contrary, the template path in the official Django tutorial is example. My own guidelines are inspired from the Pinax project which seems to be quite far in this direction. Templates: Have them in myproject/myapp/templates/myapp/, including the base.html. base.html extends site_base.html which resides in myproject/myapp/templates/ but is usually overridden in myproject/templates/. site_base.html should contain the blocks title, css, extrahead, and content. Additionally, there should be "title" in the context. Static files: Have them in myproject/myapp/media/myapp/ and use django-staticfiles for collecting them in myproject/media/. I set STATIC_ROOT (which is used by django-staticfiles) simply to MEDIA_ROOT because I don't think a distinction is really necessary. (About the additional /myapp/ in the paths: This makes it easy for the site admin to override some or all files.) Settings: There is no really good solution for it. Django-Harness seems to have found one, but I think clearly documenting them in your app's documentation should be enough. And of course, middleware, context managers, and URLs should be in the app directory, too. Furthermore, an app should not have login/logout ware, and if so, it should at least be easily overridable in the global urls.py. Use relative imports within the application's modules. They are available since Python 2.5. This way, I avoided any tampering with sys.path. Tschö, Torsten. -- Torsten Bronger, aquisgrana, europa vetus Jabber ID: torsten.bron...@jabber.rwth-aachen.de or http://bronger-jmp.appspot.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-users@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 -~----------~----~----~----~------~----~------~--~---