Hi.
I'm stuck with a problem concerning the 'resolve' and 'reverse'
functions.
urls.py:
urlpatterns = patterns('',
(r'^points/', include ('points.urls')),
(r^deliveries/, include ('deliveries.urls'))
)
points/urls.py
urlpatterns = patterns('points.views',
(r'^(?P<point_id>\d+)/$', 'point_dispatch')
)
deliveries/urls.py
urlpatterns = patterns('deliveries.views',
(r'^(?P<delivery_id>\d+)/confirmed/$',
'delivery_confirmed_conflicts_dispatch')
)
In one of the templates in the 'points' app I use the {% url %} tag to
generate the url of a Point.
Afterwards, that url is sent in a POST request to the 'deliveries' app
to confirm that the point is conflictive.
The problem arises when I run the application in a non-root
environment in Apache
(with 'WSGIScriptAplias /conflictsapp /path_to_my_django.wsgi')
Then, the '%{ url }%' tag and the 'reverse' function honor the
SCRIPT_NAME sent by mod_wsgi and return urls of the form '/
conflictsapp/points/<point_id>/
However, the 'resolve' function does not take into account
SCRIPT_NAME, and when I run 'resolve' against one of the mentioned
urls it throws a 404. So far I've solved it by stripping SCRIPT_NAME
before calling 'resolve' but I don't think that's optimal.
Is this a normal behavior, or am I misunderstunding reverse and
resolve?
Thanks in advance.
Kind regards,
Rodrigo.
--
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.