Sorry this previous example is not correct.
and i know what the problem is, i'm not sure if this is a bug.

my root URLconfs is somehow like this
urlpatterns = patterns('',
    (r'^app/',        include('app.urls')),
    (r'^$',             include('app.urls')), # )

the app URLconf is like this
 urlpatterns = patterns('',
    (r'^test/a-test', app.view.test, name='test'),
    (r'^/?$',app.views.index),
)

the app.urls appear twice in the root urls, because i wan't the app's index
view be the index view of the site.( and i don't want import the
app.view.index into the root urlconfs )
then it will cause the reverse method get the wrong url
"/test/a-test/"  instead of "/app/test/a-test/"




On 5/14/08, @@ <[EMAIL PROTECTED]> wrote:
>
> Hi,
> It seems the revese method can't work with included URLconfs?
>
> for example :
> the root URLconfs is like this
> urlpatterns = patterns('',
>     (r'^app/',        include('django_website.apps.blog.urls.blog')),
> )
>
> the app URLconfs is like this
> urlpatterns = patterns('',
>     (r'^test/a-test', 'app.view', name='test'),
> )
>
> When i want to get the "test" url
> from django.core.urlresolvers import reverse
> reverse('test')
>
> i will get /test/a-test/ instead of /app/test/a-test/
>
> Did i miss something or is there other workarounds?
>
> thanks.
>

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