Open Elon8 opened 5 years ago
at rango/views.py def show_category(request, category_name_slug): context = { 'category_name_slug': category_name_slug, } ...
def show_category(request, category_name_slug):
context = {
'category_name_slug': category_name_slug,
}
...
and then , the template: category.html <a href="/rango/category/{{ category_name_slug }}/add_page/">Add Page</a>
<a href="/rango/category/{{ category_name_slug }}/add_page/">Add Page</a>
use category_name_slug is better than use category.slug , Especially when try a wrong category_name_slug in the URL , and press the 'Add Page' link.
at rango/views.py
def show_category(request, category_name_slug):
context = {
'category_name_slug': category_name_slug,
}
...
and then , the template: category.html
<a href="/rango/category/{{ category_name_slug }}/add_page/">Add Page</a>
use category_name_slug is better than use category.slug , Especially when try a wrong category_name_slug in the URL , and press the 'Add Page' link.