My experimental Django site is has URLs like
http://allenlux.dyndns.org/cms/weblog/2008/aug/23/website-now-using-radiant/
where everything lives under the folder /cms/ ie the Apache
configuration looks like
<Location "/cms/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE cms.settings
PythonOption django.root /cms
PythonDebug On
PythonPath "['/home/usr/django-code/', '/usr/lib/python2.5/site-
packages/django/'] + sys.path"
</Location>
Within the application I'm trying to construct real complete URLs by
concatenating Site.objects.get_current().domain and get_absolute_url()
for the page object.
This works fine under some circumstances eg from the Python shell:
...
>>> Site.objects.get_current().domain
u'allenlux.dyndns.org/cms'
...
>>> page[1].get_absolute_url()
'/weblog/2008/aug/23/website-now-using-radiant/'
...
>>> Site.objects.get_current().domain+page[1].get_absolute_url()
u'allenlux.dyndns.org/cms/weblog/2008/aug/23/website-now-using-
radiant/'
>>>
But when I use the exact same expression in a custom tag, it gives
this
http://allenlux.dyndns.org/cms/cms/weblog/2008/aug/23/website-now-using-radiant/
ie the get_absolute_url() seems to be returning the /cms/ part as
well.
get_absolute_url() has the following definition (more or less copied
from "Practical Django Projects"):
def get_absolute_url(self):
return ('blog_entry_detail', (), { 'year':
self.pub_date.strftime("%Y"),
'month':
self.pub_date.strftime("%b").lower(),
'day':
self.pub_date.strftime("%d"),
'slug': self.slug })
get_absolute_url = models.permalink(get_absolute_url)
I'm obviously not understanding something here - can anyone help?
John
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---