Sunday, April 28, 2019

Re: Django URLs

What is the function 'detail' ? You need to assign 'slug' variable also in order to pass it to the url.

On Sun, 28 Apr 2019, 13:50 Aayush Bhattarai, <learntocode08@gmail.com> wrote:
Hello Everyone,

I want to pass two url in url of template. I have added in urls.py also.

code:-
Index.html
<a href="{% url 'detail' detail.id %}" target="_blank">
In Up I want to pass slug. What Should I do.

urls.py:

path("detail/<int:id>/<str:slug>"),

Thanks For Help

--
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+unsubscribe@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/e9ecfa89-1175-405a-b3d4-f3808b7f2b0f%40googlegroups.com.
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+unsubscribe@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/CAC3mK7fhj3e_LcuLwhm7Eu-qDVBWXeZNuFmqwBu15sdGpMrx-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment