Bill:  Tried that, but it made no difference.  case is resolving ok.
The problem is with the first part "/helpdesk/"  dropping off when
doing a reverse.  The same behavior happens when I use the URL tag in
a template.  "{% url case_url case.id %}"  I get /support/case/1/
without the /helpdesk in front of it.

I'm pretty sure this is because I installed Django to be served not
from the root, but rather from /helpdesk/.  I use WebFaction as a
host, and their control panel is where this is setup.  I think it uses
SymLinks to direct the shared Apache to the private one that only
serves my Django app.  But I'm not sure and can't find a way to tell
for sure.  There's nothing currently in the any of the Django files
that refers to /helpdesk/ as part of the url.  Yet the webserver
resolves it properly with /helpdesk/ there and not without it.

So I think that the first Apache server is resolving the /helpdesk/
portion of the url and then forwarding everything after that to be
handled by Django.  So maybe django doesn't know about /helpdesk/
internally.

Surely I'm not the only person who setup django to serve from a sub
url.  And WebFaction is a popular Django host.  There must be some
simple setting I'm missing somewhere.  Does anyone know what it is?

Thank you in advance.

On Dec 30 2009, 11:37 am, Bill Freeman <ke1g...@gmail.com> wrote:
> Since your urlconf is passing "case" as a named (keyword) argument, you
> (may) have to pass it that way to reverse:
>
>    ...reverse('case_url', kwargs={'case':case.id})...
>
> Bill
>
> On Mon, Dec 28, 2009 at 8:22 PM, davathar <davat...@gmail.com> wrote:
> > I'm stuck on a "reverse" problem.  The 'case' view is supposed to
> > record posted info, then reload the same page.  But it's dropping the
> > first part of the URL on the redirect and I've not been able to figure
> > out why.
>
> > It should be going to .com/helpdesk/support/case/1/  But it's going
> > to .com/support/case/1/
>
> > I'm sure it's something simple as I've had the problem in the past and
> > fumbled my way through it.  But I can't find it this time.  Hopefully
> > the below pasted lines show all the necessary detail.
>
> > Anyone see my error?
>
> > helpdesk.urls:
> > urlpatterns = patterns('',
> >    (r'^support/', include('helpdesk.support.urls')),
> > )
>
> > helpdesk.support.urls:
> > urlpatterns = patterns('helpdesk.support.views',
> >    (r'^case/(?P<case>\d+)/$', 'case',{},'case_url' ),
> > )
>
> > helpdesk.support.views:
> > def case(request, case):
> >    return HttpResponseRedirect(reverse('case_url', args=(case.id,)))
> > # Redirect back here after POST
>
> > -Shane
>
> > --
>
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.


Reply via email to