On Tue, 2007-10-30 at 18:31 +0800, Eric Abrahamsen 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.

Do you mean it does an HTTP redirect? You browser is sending the URL to
the server, so it is in control of what URL it sends, not Django. So how
is the URL changing? If it's a redirect, what is causing the redirect?
One of your views?

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

You haven't really provided enough details for me, at least, to know
what you're doing here. 

At the moment, you need to add ^django/ to the front of all your URLs in
cases like this. That will most likely be changed pre-1.0 so that it's
easier to serve from under a URL prefix (please don't say "subdirectory"
-- a subdirectory is a filesystem concept and has nothing to do with
URLs. The faster you stop thinking of URLs as files and directories, the
easier life will become). The fact that adding this prefix doesn't work
for you menas there's some other problem(s) in your code.

Perhaps construct a really small example: one url, one view, one
template that demonstrates the problem you are seeing. Then you can
paste the code here and we can repeat and understand it.

Regards,
Malcolm

-- 
A conclusion is the place where you got tired of thinking. 
http://www.pointy-stick.com/blog/


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