Thanks for your answer. =)

Yes, i tried :

import views

urlpatterns = [
    url(r'^(?P<product_slug>[\w-]+)/$', views.DocPageDetail.as_view()),
    url(r'^(?P<product_slug>[\w-]+)/(?P<subpage_slug>\w+)/$', 
views.DocPageDetail.as_view())
]



But second url pattern (with two arguments) is never found... :'(


Le mercredi 8 novembre 2017 14:19:48 UTC+1, Avraham Serour a écrit :
>
> I recommend putting two entries on urls.py, they can both point to the 
> same view.
> Just be sure to set a default value for subpage_slug on the function 
> argument
>
> On Wed, Nov 8, 2017 at 3:01 PM, <cjacq...@gmail.com <javascript:>> wrote:
>
>> Hi everyone,
>>
>> I would like to make a documentation app with urls like this (not 
>> flatpages) :
>>
>> [server]/docs/<product_slug>/ ==> go to product main help page
>>
>> [server]/docs/<product_slug>/<subpage_slug>/ ==> go to product sub help 
>> page.
>>
>> How can i write this in app urls.py ?
>>
>> Thanks !
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com <javascript:>.
>> To post to this group, send email to django...@googlegroups.com 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/3d4f0a0d-dc46-488a-9aec-a97120518e64%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/3d4f0a0d-dc46-488a-9aec-a97120518e64%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/31df8d7c-6332-4cc6-96d9-71af0b994ba8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to