{"id":120197,"date":"2024-12-17T05:15:15","date_gmt":"2024-12-17T05:15:15","guid":{"rendered":"\/tutorials\/?p=120197"},"modified":"2024-12-20T10:11:35","modified_gmt":"2024-12-20T10:11:35","slug":"working-with-django-templates","status":"publish","type":"post","link":"\/in\/tutorials\/working-with-django-templates","title":{"rendered":"How to create and use Django templates"},"content":{"rendered":"<p>Django templates play a crucial role in defining the look and feel of your web pages while maintaining a clean separation of concerns between the logic, which is handled by views, and the user interface.<\/p><p>In this article, you&rsquo;ll learn more about Django templates, how to set them up, and the many ways to use them.<\/p><p>\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-what-are-django-templates\">What are Django templates?<\/h2><p>The <span style=\"margin: 0px;padding: 0px\">Django template<strong>&nbsp;<\/strong>system is designed to separate data presentation from<\/span> underlying logic. Templates are essentially HTML files that contain dynamic content, allowing you to display data passed from your <a href=\"\/in\/tutorials\/building-django-views\">Django views<\/a>.<\/p><p>The <strong>Django Template Language <\/strong>(DTL) provides placeholders and logic, like loops and conditionals, to insert dynamic data into HTML.<\/p><p>In addition to simplifying the development process, it organizes your project structure when deploying it to a <a href=\"\/in\/vps\/django-hosting\">Django virtual private server<\/a> (VPS).<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/in\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner-1024x300.png\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-setting-up-django-templates\">Setting up Django templates<\/h2><p>Setting up templates in Django is not difficult at all. Here&rsquo;s a quick guide.<\/p><h3 class=\"wp-block-heading\" id=\"h-how-to-create-a-template\">How to create a template<\/h3><p>To create a template in Django, you need to create an HTML file inside a <strong>templates <\/strong>directory. The directory structure might look like this:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">myproject\/\n&#9474;\n&#9500;&#9472;&#9472; myapp\/\n&#9474;   &#9500;&#9472;&#9472; templates\/\n&#9474;   &#9474;   &#9492;&#9472;&#9472; myapp\/\n&#9474;   &#9474;       &#9492;&#9472;&#9472; homepage.html\n&#9474;   &#9492;&#9472;&#9472; views.py\n&#9474;\n&#9492;&#9472;&#9472; manage.py<\/pre><p>In this structure, Django automatically looks for templates in the <strong>templates <\/strong>directory of your app. You can further organize templates inside app-specific folders (like <strong>myapp\/homepage.html<\/strong>), ensuring that each app has its own templates.<\/p><p>Here&rsquo;s an example of a simple template (<strong>homepage.html<\/strong>):<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n    &lt;title&gt;Home&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;h1&gt;Welcome to {{ site_name }}&lt;\/h1&gt;\n    &lt;p&gt;{{ message }}&lt;\/p&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre><p>In this template, <strong>{{ site_name }}<\/strong> and <strong>{{ message }}<\/strong> are placeholders that will be filled with dynamic data passed from the view.<\/p><h3 class=\"wp-block-heading\" id=\"h-rendering-templates-in-views\">Rendering Templates in views<\/h3><p>To render a template, you need to pass it to the view using Django&rsquo;s <strong>render()<\/strong> function. Here&rsquo;s an example of how to render the <strong>homepage.html<\/strong> template with some context data in a <strong>function-based view (FBV)<\/strong>:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from django.shortcuts import render\n\ndef homepage(request):\n    context = {\n        'site_name': 'My Django Website',\n        'message': 'This is the homepage content!'\n    }\n    return render(request, 'myapp\/homepage.html', context)<\/pre><p>In this example, <strong>render()<\/strong> combines the template (<strong>homepage.html<\/strong>) with data inside <strong>context<\/strong>. <strong>Context<\/strong> is a dictionary containing the data that Django will insert into the template (<strong>site_name<\/strong> and <strong>message<\/strong>).<\/p><p>When a user visits this page, the placeholders <strong>{{ site_name }}<\/strong> and <strong>{{ message }}<\/strong> in the template will be replaced by &ldquo;<strong>My Django Website<\/strong>&rdquo; and &ldquo;<strong>This is the homepage content!<\/strong>&rdquo; respectively, as specified in <strong>context<\/strong>.<\/p><h2 class=\"wp-block-heading\" id=\"h-using-template-tags-and-filters\">Using template tags and filters<\/h2><p>Django templates also support <strong>template tags<\/strong> and <strong>filters<\/strong>, which allow you to add dynamic content and logic inside your HTML files.<\/p><p><strong>Template tags<\/strong> enable you to perform logic inside templates, such as loops and conditionals, instead of directly rendering the value. For example, the following code include an <strong>if <\/strong>condition:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{% if user.is_authenticated %}\n    &lt;p&gt;Welcome back, {{ user.username }}!&lt;\/p&gt;\n{% else %}\n    &lt;p&gt;Hello, Guest!&lt;\/p&gt;\n{% endif %}<\/pre><p>Meanwhile,<strong> template filters <\/strong>take values from variables and modify it for display purposes. For instance the following filter take article publishing date and show it in a <strong>MMMM\/DD\/YYY<\/strong> format:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;p&gt;Published on {{ article.published_date|date:\"F j, Y\" }}&lt;\/p&gt;<\/pre><h2 class=\"wp-block-heading\" id=\"h-inheriting-templates\">Inheriting templates<\/h2><p>Django supports template inheritance, allowing you to create base templates that other templates can extend. This is especially useful for maintaining a consistent layout across multiple pages, such as a common header and footer.<\/p><h3 class=\"wp-block-heading\" id=\"h-creating-a-base-template\">Creating a base template<\/h3><p>The structure of the base template (<strong>base.html<\/strong>) is the same as other templates. Here&rsquo;s an example code:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n    &lt;title&gt;{% block title %}My Site{% endblock %}&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;header&gt;\n        &lt;h1&gt;Site Header&lt;\/h1&gt;\n    &lt;\/header&gt;\n\n    &lt;main&gt;\n        {% block content %}\n        &lt;!-- Page-specific content goes here --&gt;\n        {% endblock %}\n    &lt;\/main&gt;\n\n    &lt;footer&gt;\n        &lt;p&gt;Footer Content&lt;\/p&gt;\n    &lt;\/footer&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre><h3 class=\"wp-block-heading\" id=\"h-extending-a-template\">Extending a template<\/h3><p>To extend the base template, create a new template with the<strong> {% template %}<\/strong> tag. Here&rsquo;s a code example of a child template (<strong>homepage.html<\/strong>):<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{% extends 'base.html' %}\n\n{% block title %}Home Page{% endblock %}\n\n{% block content %}\n    &lt;h2&gt;Welcome to the homepage!&lt;\/h2&gt;\n    &lt;p&gt;This is the homepage content.&lt;\/p&gt;\n{% endblock %}<\/pre><p>By extending the base template, you can reuse the header and footer across different pages, maintaining a consistent layout and avoiding repetition.<\/p><h2 class=\"wp-block-heading\" id=\"h-including-static-files-in-templates\">Including static files in templates<\/h2><p>Templates also allow you to reference static files (like CSS, JavaScript, or images) using the <strong>{% static %}<\/strong> template tag. For example, to include a CSS file:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"{% static 'css\/style.css' %}\"&gt;<\/pre><p>Make sure you&rsquo;ve set up your static file directories correctly in <strong>settings.py<\/strong>:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">STATIC_URL = '\/static\/'<\/pre><p>By effectively using Django&rsquo;s template system, you can create dynamic, data-driven web pages and maintain a clean separation between logic and presentation.<\/p><h2 class=\"wp-block-heading\" id=\"h-context-variables-in-templates\">Context variables in templates<\/h2><p>Context variables let you pass data from your views to templates for rendering. They enable you to process dynamic data that changes based on the process in your view. For example, you can make a web page that automatically updates to show the latest post.<\/p><p>To use context variables, add a key-value pair in your views&rsquo; dictionary. The key specifies the variable names, while the value is the data you want to pass.<\/p><p>In this simple example, we create the <strong>latest_posts <\/strong>and <strong>page_title<\/strong> context variables in the homepage&rsquo;s view. The <strong>latest_posts<\/strong> fetches data from the <strong>latest_posts <\/strong>queryset while <strong>page_title <\/strong>passes the page title:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from django.shortcuts import render\nfrom .models import Post\n\ndef home(request):\n    # Query the latest blog posts\n    latest_posts = Post.objects.order_by('-published_date')[:5]  # Get the 5 most recent posts\n    context = {\n        'latest_posts': latest_posts,\n        'page_title': 'Home - My Blog',\n    }\n    return render(request, 'home.html', context)<\/pre><p>To render the context variable in your template, call them by writing their names inside the placeholder tags. For example, if you have a variable called <strong>data<\/strong>, display it using <strong>{{ data }}<\/strong>.<\/p><p>Let&rsquo;s insert the simple code example above into the<strong> home.html <\/strong>template. The code should look as follows:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n    &lt;title&gt;{{ page_title }}&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;h1&gt;Latest Blog Posts&lt;\/h1&gt;\n    &lt;ul&gt;\n        {% for post in latest_posts %}\n            &lt;li&gt;\n                &lt;h2&gt;{{ post.title }}&lt;\/h2&gt;\n                &lt;p&gt;{{ post.content|truncatewords:30 }}&lt;\/p&gt;  &lt;!-- Show a snippet of the content --&gt;\n                &lt;a href=\"{% url 'post_detail' post.id %}\"&gt;Read more&lt;\/a&gt;\n            &lt;\/li&gt;\n        {% empty %}\n            &lt;li&gt;No posts available.&lt;\/li&gt;\n        {% endfor %}\n    &lt;\/ul&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre><p>Based on our previous explanation, the example code renders the <strong>page_title<\/strong> variable since we insert it using placeholders. However, we use template tags to call the <strong>latest_post<\/strong> context variable and apply logic to process the data.<\/p><p>In the example above, we use <a href=\"\/in\/tutorials\/python-for-loop\">for loop<\/a> to iterate through the fetched posts, pulling data like truncated content, ID, and title.<\/p><h2 class=\"wp-block-heading\" id=\"h-working-with-template-blocks\">Working with template blocks<\/h2><p>Your website might have multiple pages with the same layout but different content. For example, the home&rsquo;s head tags contain the blog name, but it changes to <strong>About me<\/strong> on the contact page.<\/p><p>Instead of creating different templates for each page, Django provides blocks that serve as a dynamic content placeholder. You can create one using a template tag like so:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{% block name %}HTML content{% endblock %} <\/pre><p>To use blocks, you need at least two templates &ndash; one for the base and another for the inherited content.<\/p><p>Let&rsquo;s consider the previous example of the home and contact page. To begin, create a <strong>base.html <\/strong>template that gives the basic structure for your content. The content looks as follows:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!-- base.html --&gt;\n&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n    &lt;title&gt;{% block title %}Default Title{% endblock %}&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;\/html&gt;<\/pre><p>Then, create two child templates that will extend the <strong>base.html<\/strong> file&rsquo;s content. The basic structure looks like this:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!-- child.html --&gt;\n{% extends \"base.html\" %}\n{% block title %}Child Page Title{% endblock %}<\/pre><p>Replace <strong>Child Page Title<\/strong> according to the home and contact information page&rsquo;s title. Now, define the view to render these templates:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># views.py\nfrom django.shortcuts import render\n\ndef home(request):\n    return render(request, 'home.html')\n\ndef about(request):\n    return render(request, 'contactinfo.html')<\/pre><p>Specify the URL path that will render child template views in the <strong>urls.py<\/strong> file:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># urls.py\nfrom django.urls import path\n# import your views\nfrom .views import home, contactinfo\n\nurlpatterns = [\n    path('', home, name='home'),\n    path('contactinfo\/', contactinfo, name='contactinfo'),\n]<\/pre><p>Since we set the <strong>home<\/strong> path as empty, you can render the template by simply entering your website domain name. Meanwhile, the contact information content shows in <strong>domain.com\/contactinfo\/<\/strong>.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>Django templates are HTML content of your website that loads dynamic data from views. They separate the content from the logic, enabling you to modify or reuse the code more easily.<\/p><p>Template files are located inside your Django application&rsquo;s templates folder. To insert data passed from views, use the <strong>{{ variable }}<\/strong> tag. For example, if you want to display a title from the view, add <strong>{{ title }}<\/strong>.<\/p><p>To apply logic to the rendered data, use the <strong>{% variable %}<\/strong> tag. For example, you can iterate through a context variable and fetch additional data. You can also use the <strong>if<\/strong> statement to process the content.<\/p><p>Templates can inherit content from their child using blocks. To do so, insert <strong>{% block name %}HTML content{% endblock %} <\/strong>into both the base and child templates to specify the the dynamic content placeholder. <\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-use-django-templates-faq\">How to use Django templates FAQ<\/h2><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1734409399548\"><h3 class=\"schema-faq-question\">What is the Django template language?<\/h3> <p class=\"schema-faq-answer\">Django&rsquo;s template language is a text-based system for defining dynamic HTML. It uses <strong>{{ variables }} <\/strong>to render data,<strong> {% tags %}<\/strong> for logic (if\/for loops), and filters like <strong>{{ value|length }}<\/strong> to transform data. It lets you separate Python logic from presentation while maintaining security through automatic escaping.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1734409420568\"><h3 class=\"schema-faq-question\">How do I render a template in Django?<\/h3> <p class=\"schema-faq-answer\">In Django, render a template using the<strong> render()<\/strong> function in your views. The code syntax looks as follows: <strong>return render(request, &lsquo;template.html&rsquo;<\/strong>, <strong>{&lsquo;context&rsquo;: data})<\/strong>.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1734409433994\"><h3 class=\"schema-faq-question\">How can I secure my Django templates?<\/h3> <p class=\"schema-faq-answer\">Django templates are automatically XSS-protected through HTML escaping. To improve security, yse <strong>{% csrf_token %}<\/strong> in forms for CSRF protection, avoid <strong>{{ var|safe }}<\/strong> unless necessary, and keep sensitive data out of template context. Also, use template inheritance wisely and never pass untrusted user input directly to templates.<\/p> <\/div> <\/div><p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Django templates play a crucial role in defining the look and feel of your web pages while maintaining a clean separation of concerns between the logic, which is handled by views, and the user interface. In this article, you&rsquo;ll learn more about Django templates, how to set them up, and the many ways to use [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/in\/tutorials\/working-with-django-templates\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":185,"featured_media":120144,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"","rank_math_description":"","rank_math_focus_keyword":"","footnotes":""},"categories":[22642,22640],"tags":[],"class_list":["post-120197","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-pre-installed-applications","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/working-with-django-templates","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/working-with-django-templates","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/working-with-django-templates","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/working-with-django-templates","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/working-with-django-templates","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/working-with-django-templates","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/working-with-django-templates","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/working-with-django-templates","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/120197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/users\/185"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/comments?post=120197"}],"version-history":[{"count":6,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/120197\/revisions"}],"predecessor-version":[{"id":120597,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/120197\/revisions\/120597"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/media\/120144"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/media?parent=120197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/categories?post=120197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/tags?post=120197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}