Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (19.9k points)

I have this if for a static page:

{% if request.get_full_path == "billing/address/" %}

    test

{% endif %}

how can I replace billing/address/ with the path getting from here:

path('billing/address/<slug:address_slug>/', views.addressChange, name='edit-address')

Thanks guys

1 Answer

0 votes
by (25.1k points)

You can use python's in operator, like this:

{% if "billing/address/" in request.get_full_path %}

    test

{% endif %}

Related questions

0 votes
1 answer
asked Jul 4, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
asked Oct 5, 2019 in Web Technology by Rajesh Malhotra (19.9k points)
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...