The other answers require you to pass an additional context variable. But as long as you can access the request object, there is no need:
{% extends request.is_ajax|yesno:"app/base_ajax.html,app/base.html" %}
I found this to be much more convenient.
More Related Contents:
- Django CSRF check failing with an Ajax POST request
- How do I integrate Ajax with Django applications?
- Creating a dynamic choice field
- Performing a getattr() style lookup in a django template
- Django, creating a custom 500/404 error page
- Reference list item by index within Django template?
- django html template can’t find static css and js files
- Where’s my JSON data in my incoming Django request?
- How to compare dates in Django templates
- how to iterate through dictionary in a dictionary in django template?
- Iterating through two lists in Django templates
- How do I include image files in Django templates?
- NoReverseMatch with keyword argument uidb64 with Django 2.0
- How to make Django slugify work properly with Unicode strings?
- Django: Display Choice Value
- How do I perform query filtering in django templates
- is there a way to loop over two lists simultaneously in django?
- What is the path that Django uses for locating and loading templates?
- Access request in django custom template tags
- How to get the domain name of my site within a Django template?
- matching query does not exist Error in Django
- How to access the user profile in a Django template?
- How do I call a Django function on button click?
- How to put comments in Django templates?
- Sorting related items in a Django template
- Rendering JSON objects using a Django template after an Ajax call
- Django foreign key relation in template
- How to add multiple arguments to my custom template filter in a django template?
- Serve a dynamically generated image with Django
- Override existing Django Template Tags