Probably everyone here knows this already, but I did find a working solution in the documentation on the Sites framework: it was to concatenate Site.objects.get_current() with page.get_absolute_url().
To show this in context, I am using it within the custom template tag for a "simple menu for Django flatpages" described here: http://blog.foozia.com/blog/2007/jul/29/simple-menu-django-flatpages/ The complete working code now looks like this: from django.template import Library, Node from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site register = Library() def flatpage_menu(): # Create an unordered list of all flatpages pages = FlatPage.objects.all() menu = '<ul>' for page in pages: menu += '<li>'+'<a href="http://'+Site.objects.get_current().domain +page.get_absolute_url()+'" title="'+page.title+'">'+page.title+'</a></ li>\n' menu += '</ul>' return menu register.simple_tag(flatpage_menu) This assumes that SITE_ID is correctly set in the settings.py file for the project. John Allen Bofferdange, Luxembourg On Sep 15, 11:49 pm, allenlux <[EMAIL PROTECTED]> wrote: > I'm a newcomer to django but so far most things seem to work nicely. > > One detail which has left me baffled is how to get working urls for flatpages > used in my site. For example, take a flatpage for which the > url field is set to "/about/" > > The site as a whole has URLs of the form "http://allenlux.dyndns.org/ > cms/about/" > > However, trying to assemble the URL with something like > "page.get_absolute_url()" gives the result > "http://allenlux.dyndns.org/about/" > that is, the get_absolute_url method of theflatpagesmodel doesn't > seem to know about the "cms" part of the site path. > > I found this thread > http://groups.google.com/group/django-users/browse_thread/thread/1be3... > > which seems to deal with a related issue (or maybe the same issue) but > the thread ended without a solution, so I thought I would try again. > > John Allen > Bofferdange, Luxembourg --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---