On Oct 31, 1:15 am, [EMAIL PROTECTED] wrote:
> This issue has come up for many people in many places, but most of the
> threads seem old, and none of the solutions proposed has helped.
>
> I have a django installation in a subdirectory of a site, like 
> so:www.mysite.com/django. At first I noticed a problem with the admin
> login, like other people have had (where the /django/ portion of the
> url is removed when you try to login, leading to a 404), and solved it
> by copying some of the admin template pages into my own project
> template directory.
>
> It appears that the problem also affects ALL url tags in my templates:
> using the {% url path/to/view %} tag produces a URL which doesn't
> include the /django/ section, meaning it's invalid. Trying to cheat
> like this:
> href="/django{% url path/to/view %}"
> produces the correct url in the template page, but when I actually
> click the link, django removes the /django/ section from the url in
> the browser address bar, and then tells me it can't find the page.
>
> I've tried adding r'^django/' at the front of the urls in my url
> config, but that just results in none of the urls matching.
>
> Does anyone have an explanation or a solution for this?

If you use mod_wsgi, it contains instructions for how to mount
application on a sub url rather than at root. To make it all work
requires doing a workaround in the WSGI wrapper around Django to cope
with Django not recognising SCRIPT_NAME variable properly. Also
necessary to ensure urls.py path include prefix as well. See:

  http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango

This has links to relevant Django tickets where the problem is raised.

Graham


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to