Sphene Community Tools

Community

Copyright © 2007-2018 by Herbert Poul

You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools
Board » General » Templates location

Hi!

Is there any particular reason to have templates in sphenecoll/templates and not in application folders? I think about structure like:

- sphenecoll/sphene/sphblog/templates
- sphenecoll/sphene/sphboard/templates
- ...

The above is IMHO better, because it allows us to use automatic template loaders and get rid of hardcoded paths from template_dirs in settings.py. See: Django docs for more.
i have to admit that it doesn't have any particular reason .. i basically decided on that layout before i were familiar enough with django ..

i just never felt the need to change it .. since after adding the directory once to the settings.py .. you can forget about it :)

but i have to admit that there is no reason not to change it .. so .. i did it: http://yourhell.com/wsvn/root/django/communitytools/?rev=435&sc=1

this at least saves everyone one step when integrating SCT .. so i guess it's worth it ;)
Hey, we have Signatures !!! Great, isn't it ? ;)
i have to admit that it doesn't have any particular reason .. i basically decided on that layout before i were familiar enough with django ..

i just never felt the need to change it .. since after adding the directory once to the settings.py .. you can forget about it :)

but i have to admit that there is no reason not to change it .. so .. i did it: http://yourhell.com/wsvn/root/django/communitytools/?rev=435&sc=1
Great! Thanks a lot for implementing this! One more thing to mention here is that make-messages.py (i18n stuff) scans all files that are on the same level as the script and below it. So to generate messages I had to manually copy templates into an application folder to get it working.

this at least saves everyone one step when integrating SCT .. so i guess it's worth it ;)

Oh yes. It had confused me when I first looked at SCT. This change and MEDIA_URL one will make the process of integrating SCT easier.

One more thing I think about is replacing hardcoded urls like:
../../something
with
reverse()
and
{% url ... %}
(in templates) calls. It caused some problems to me when I symlinked templates to application folders and media to some path.
One more thing I think about is replacing hardcoded urls like:
../../something
with
reverse()
and
{% url ... %}
(in templates) calls. It caused some problems to me when I symlinked templates to application folders and media to some path.
there shouldn't be too much of those links any more .. i have replaced most of them (i only know of the 'Board' link in the breadcrumbs which is still hardcoded) - {% url ... %} won't work for SCT though .. i made my own {% sph_url .. %} because it has to pass through the 'urlconf' object ..
Hey, we have Signatures !!! Great, isn't it ? ;)
there shouldn't be too much of those links any more .. i have replaced most of them (i only know of the 'Board' link in the breadcrumbs which is still hardcoded) - {% url ... %} won't work for SCT though .. i made my own {% sph_url .. %} because it has to pass through the 'urlconf' object ..
Err.. Searching through files for '../' shows:

For sphBoard
- _displayBreadcrumbs.html (2 matches)
- _displayCategories.html
- _displayLatestPost.html (4 matches)
- listCategories.html (12 matches)
- showThread.thml (18 matches)
- views.py (8 matches)


--- Last Edited by Jakub Wiśniowski at 2008-02-17 21:12:42 ---
oops .. ok :) .. i guess the board link was the only one that made problems so far ..
Hey, we have Signatures !!! Great, isn't it ? ;)

Please login to post a reply.



Powered by Sphene Community Tools