Is it possible to resolve a page url by its slug? Something like:
from django.core.urlresolvers import reverse
reverse('pages-details-by-slug',{slug:'my-page-slug'})
But I got:
NameError: name 'slug' is not defined
Any help on this?
Python is not Javascript; dictionary keys need to be quoted.
reverse('pages-details-by-slug', {'slug': 'my-page-slug'})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With