{"id":119345,"date":"2024-11-26T10:04:03","date_gmt":"2024-11-26T10:04:03","guid":{"rendered":"\/tutorials\/?p=119345"},"modified":"2025-05-22T07:33:16","modified_gmt":"2025-05-22T07:33:16","slug":"building-django-views","status":"publish","type":"post","link":"\/tutorials\/building-django-views","title":{"rendered":"Django views: what they are, different types and how to use them"},"content":{"rendered":"<p>Django views are a key component of any web application, bridging your application&rsquo;s data and user interface. <\/p><p>Once your Django database and models are set up to manage data, views define how this data is processed and presented to users, forming the logic and structure behind web pages.<\/p><p>\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-what-are-views-in-django\">What are views in Django?<\/h2><p>Django views are an essential component that handles the logic of how your application responds to user requests.<\/p><p>Simply put, a view takes a web request, processes it, and returns a response &ndash; often in the form of a rendered HTML page. Views act as a bridge between the application&rsquo;s data, managed by models, and its presentation, handled by <a href=\"\/tutorials\/working-with-django-templates\">Django templates<\/a>.<\/p><h2 class=\"wp-block-heading\" id=\"h-types-of-django-views\">Types of Django views<\/h2><p>Django has two primary types of views: <strong>Function-Based Views (FBVs)<\/strong> and <strong>Class-Based Views (CBVs)<\/strong>. Both serve the same purpose but offer different ways of organizing code.<\/p><p><strong>Function-Based Views (FBVs)<\/strong><\/p><p>Function-Based Views are simple Python functions to handle HTTP requests and return responses. They are intuitive and ideal where you need more control over every aspect of the request and response lifecycle.<\/p><p>Here&rsquo;s an example of a simple FBV that renders an HTML template:<\/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\n# Function-based view\ndef homepage(request):\n    return render(request, 'homepage.html')<\/pre><p>In this example:<\/p><ul class=\"wp-block-list\">\n<li><strong>request<\/strong> &ndash; represents the HTTP request object containing metadata about the user&rsquo;s request.<\/li>\n\n\n\n<li><strong>render<\/strong> &ndash; Combines the <strong>homepage.html<\/strong> template with context data if provided and returns an <strong>HttpResponse<\/strong> object.<\/li>\n<\/ul><p>FBVs are easy to understand and implement, but can lead to bloated functions with complex logic if not carefully managed, especially when handling tasks like <a href=\"\/tutorials\/django-forms\">forms<\/a>, authentication, or reusable patterns.<\/p><p><strong>Class-Based Views (CBVs)<\/strong><\/p><p>CBVs, on the other hand, utilize the principles of inheritance and encapsulation to create more structured and reusable views. They let developers take advantage of Django&rsquo;s built-in generic views and easily override or extend methods for customization.<\/p><p>Built-in generic views like <strong>ListView<\/strong> and <strong>DetailView<\/strong> reduce boilerplate code by providing ready-made logic for tasks like rendering object lists, details, forms, and more.<\/p><p>Here&rsquo;s an example of a CBV that performs the same function as the previous FBV:<\/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.views.generic import TemplateView\n\n# Class-based view\nclass HomePageView(TemplateView):\n    template_name = 'homepage.html'<\/pre><p>In this example:<\/p><ul class=\"wp-block-list\">\n<li><strong>TemplateView<\/strong> &ndash; A built-in generic view that renders a template.<\/li>\n\n\n\n<li><strong>template_name<\/strong> &ndash; specifies the template file to render, just like in the FBV example.<\/li>\n<\/ul><p>To use this CBV in the URL configuration, you&rsquo;ll need to include the <strong>.as_view()<\/strong> method when adding it to <strong>urls.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=\"\">from django.urls import path\nfrom .views import HomePageView\n\nurlpatterns = [\n    path('', HomePageView.as_view(), name='home'),\n]<\/pre><h3 class=\"wp-block-heading\" id=\"h-when-to-use-fbvs-vs-cbvs\"><strong>When to use FBVs vs. CBVs<\/strong>?<\/h3><ul class=\"wp-block-list\">\n<li><strong>Use FBVs<\/strong> when you need simplicity and full control over your view logic. They are often more intuitive for small views or custom logic that doesn&rsquo;t fit into Django&rsquo;s predefined view patterns.<\/li>\n\n\n\n<li><strong>Use CBVs<\/strong> when you want to follow <strong>Don&rsquo;t Repeat Yourself (DRY)<\/strong> principles and reuse existing logic. CBVs are ideal when your views grow in complexity, such as when handling forms, paginated data, or standard CRUD operations.<\/li>\n<\/ul><p>Both FBVs and CBVs are integral to Django, and choosing between them depends on your project&rsquo;s requirements and your personal preference.<\/p><p>For inspirations, some developers prefer to start with FBVs for prototyping or small projects and switch to CBVs as the project scales or when they need more structure and reusability.<\/p><h2 class=\"wp-block-heading\" id=\"h-built-in-generic-views-in-django\">Built-in generic views in Django<\/h2><p>Django&rsquo;s built-in generic views provides a way to handle repetitive patterns like displaying lists, managing forms, and handling CRUD operations with minimal boilerplate code.<\/p><p>Here are some commonly used ones:<\/p><ul class=\"wp-block-list\">\n<li><strong>DetailView <\/strong>&ndash; displays a detail page for a single object.<\/li>\n\n\n\n<li><strong>ListView <\/strong>&ndash; renders a list of objects.<\/li>\n\n\n\n<li><strong>CreateView <\/strong>&ndash; handles the creation of a new object and displays a form.<\/li>\n\n\n\n<li><strong>UpdateView <\/strong>&ndash; manages updating an existing object.<\/li>\n\n\n\n<li><strong>DeleteView <\/strong>&ndash; provides a form to delete an existing object.<\/li>\n\n\n\n<li><strong>TemplateView <\/strong>&ndash; renders a static template.<\/li>\n\n\n\n<li><strong>RedirectView <\/strong>&ndash; redirects to a different URL.<\/li>\n\n\n\n<li><strong>FormView <\/strong>&ndash; displays a form and processes it upon submission.<\/li>\n<\/ul><p>These views streamline many operations, so that developers can handle repetitive tasks with minimal code.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-customize-django-views\">How to customize Django views?<\/h2><p>Customizing Django views typically involves adding custom logic for handling data, interacting with models, and returning specific responses based on the user&rsquo;s actions.<\/p><h3 class=\"wp-block-heading\" id=\"h-customizing-fbvs\">Customizing FBVs<\/h3><p>You can add logic before or after rendering a template, interact with models, handle forms, or return custom responses like JSON. Here&rsquo;s an example of customizing an FBV for handling both <strong>GET<\/strong> and <strong>POST<\/strong> requests:<\/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.http import HttpResponse\nfrom django.shortcuts import render\nfrom .models import MyModel\n\ndef my_custom_view(request):\n    if request.method == 'POST':\n        # Handle POST request logic\n        data = request.POST['data']\n        # Do something with the data, e.g., saving to the database\n        MyModel.objects.create(data_field=data)\n        return HttpResponse(\"Data Saved!\")\n\n    # Additional custom logic for GET requests\n    context = {'items': MyModel.objects.all()}\n    return render(request, 'my_template.html', context)\n<\/pre><p>In the above snippet, <strong>POST<\/strong> extracts data from the form, processes it &ndash; in this case, saving it to the database &ndash; and returns a response. Meanwhile, <strong>GET<\/strong> requests retrieve all items from the database, send them to the template, and render the page.<\/p><p>You can also use decorators like <strong>@login_required<\/strong> or custom ones for specific behavior, such as access control. For instance:<\/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.contrib.auth.decorators import login_required\n\n@login_required\ndef my_protected_view(request):\n    # This view is only accessible to logged-in users\n    return HttpResponse(\"Hello, authenticated user!\")\n<\/pre><h3 class=\"wp-block-heading\" id=\"h-customizing-cbvs\">Customizing CBVs<\/h3><p>CBVs offer a structured way to customize views by overriding methods, such as <strong>get()<\/strong> and <strong>post()<\/strong>. In the following example, we demonstrate how to customize CBVs for different request methods:<\/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.views import View\nfrom django.http import HttpResponse\nfrom .models import MyModel\n\nclass MyCustomView(View):\n    def get(self, request):\n        # Custom logic for GET request\n        items = MyModel.objects.all()\n        return render(request, 'my_template.html', {'items': items})\n    \n    def post(self, request):\n        # Custom logic for POST request\n        data = request.POST['data']\n        MyModel.objects.create(data_field=data)\n        return HttpResponse(\"Data Saved!\")\n<\/pre><p>The above snippet uses a basic class-based view to handle both <strong>GET<\/strong> and <strong>POST<\/strong> requests, making it easier to implement custom behavior for each request type<\/p><p>Django&rsquo;s CBVs also provide built-in functionality for common operations like listing objects or creating a form. You can customize their behavior by overriding class methods like <strong>get_queryset():<\/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.views.generic import ListView\nfrom .models import MyModel\n\nclass MyFilteredListView(ListView):\n    model = MyModel\n    template_name = 'filtered_list.html'\n    \n    def get_queryset(self):\n        # Customize the queryset to only include certain items\n        return MyModel.objects.filter(active=True)\n<\/pre><p>In the above example, the view customizes the queryset by filtering the items it returns, so only active entries are displayed.<\/p><h2 class=\"wp-block-heading\" id=\"h-url-configuration-for-django-views\">URL configuration for Django views<\/h2><p>Let&rsquo;s look at how a simple project might set up <a href=\"\/tutorials\/django-url-patterns\">Django URL patterns<\/a>:<\/p><ol class=\"wp-block-list\">\n<li>Project-Level URLs (<strong>myproject&rarr;urls.py<\/strong>)<\/li>\n<\/ol><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.contrib import admin\nfrom django.urls import path, include\n\nurlpatterns = [\n    path('admin\/', admin.site.urls),  # Admin site\n    path('', include('myapp.urls')),  # Include app-level URLs for \"myapp\"\n]<\/pre><ul class=\"wp-block-list\">\n<li><strong>path()<\/strong> &ndash; maps URL patterns to views or other URL configurations.<\/li>\n\n\n\n<li><strong>admin.site.urls<\/strong> &ndash; routes requests to Django&rsquo;s built-in admin interface.<\/li>\n\n\n\n<li><strong>include()<\/strong> &ndash; delegates routing to the app-level <strong>urls.py<\/strong> file for modular URL management.<\/li>\n<\/ul><ol start=\"2\" class=\"wp-block-list\">\n<li>App-Level URLs (<strong>myproject&rarr;myapp&rarr;urls.py<\/strong>)<\/li>\n<\/ol><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.urls import path\nfrom . import views\n\nurlpatterns = [\n    path('', views.homepage, name='home'),  # Maps the root URL to the homepage view\n    path('about\/', views.about, name='about'),  # Maps \"\/about\/\" to the about view\n]<\/pre><ul class=\"wp-block-list\">\n<li>The <strong>root URL<\/strong> (represented by &lsquo; &lsquo;) is mapped to the homepage view.<\/li>\n\n\n\n<li>The<strong> \/about\/ URL<\/strong> is mapped to the about<strong> <\/strong>view.<\/li>\n<\/ul><h3 class=\"wp-block-heading\" id=\"h-adding-fbvs-to-url-patterns\">Adding FBVs to URL patterns<\/h3><p>Here&rsquo;s how the corresponding views might look in <strong>views.py<\/strong> for the above URL configuration:<\/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    return render(request, 'homepage.html')\n\ndef about(request):\n    return render(request, 'about.html')<\/pre><p>The FBVs, <strong>homepage<\/strong> and <strong>about<\/strong>, are linked to URL patterns in the app-level<strong> urls.py<\/strong>, ensuring the correct view is called for each URL: <strong>http:\/\/example.com\/<\/strong> and <strong>http:\/\/example.com\/about\/<\/strong>.<\/p><h3 class=\"wp-block-heading\" id=\"h-adding-cbvs-to-url-patterns\">Adding CBVs to URL patterns<\/h3><p>You can also map URLs to CBVs, which are handled slightly differently. Here&rsquo;s an example:<\/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.urls import path\nfrom .views import HomePageView, AboutPageView\n\nurlpatterns = [\n    path('', HomePageView.as_view(), name='home'),\n    path('about\/', AboutPageView.as_view(), name='about'),\n]<\/pre><p>And the corresponding class-based views in <strong>views.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=\"\">from django.views.generic import TemplateView\n\nclass HomePageView(TemplateView):\n    template_name = 'homepage.html'\n\nclass AboutPageView(TemplateView):\n    template_name = 'about.html'<\/pre><p>The <strong>.as_view()<\/strong> method links the class-based views to the URL patterns.<\/p><h2 class=\"wp-block-heading\" id=\"h-handling-http-methods-with-views\">Handling HTTP methods with views<\/h2><p>Here&rsquo;s how FBVs and CBVs handle HTTP methods differently:<\/p><h3 class=\"wp-block-heading\" id=\"h-using-fbvs-to-handle-http-methods\">Using FBVs to handle HTTP methods<\/h3><p>FBVs handle HTTP methods by checking the request method explicitly using <strong>request.method<\/strong>. You can define custom logic for each method, like <strong>GET<\/strong> and <strong>POST<\/strong> within the same function:<\/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.http import HttpResponse\nfrom django.shortcuts import render\nfrom .models import MyModel\n\ndef my_view(request):\n    if request.method == 'GET':\n        # Logic for GET requests\n        items = MyModel.objects.all()\n        return render(request, 'my_template.html', {'items': items})\n    elif request.method == 'POST':\n        # Logic for POST requests\n        data = request.POST.get('data')\n        MyModel.objects.create(data_field=data)\n        return HttpResponse(\"Data saved!\")\n    else:\n        return HttpResponse(\"Unsupported HTTP method\", status=405)<\/pre><p>Here, <strong>request.method<\/strong> contains the HTTP method &ndash; <strong>GET<\/strong> or <strong>POST<\/strong> &ndash; as a string. However, you need to handle unsupported methods explicitly.<\/p><h3 class=\"wp-block-heading\" id=\"h-using-cbvs-to-handle-http-methods\">Using CBVs to handle HTTP methods<\/h3><p>CBVs simplify handling HTTP methods by providing dedicated methods for each type of request. Django automatically dispatches incoming requests to the appropriate method, eliminating the need for manual checks as in FBVs.<\/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.views import View\nfrom django.http import JsonResponse\n\nclass ExampleView(View):\n    def get(self, request):\n        return JsonResponse({'message': 'This is a GET response'})\n\n    def post(self, request):\n        data = request.POST.get('data', None)\n        return JsonResponse({'message': f'Received POST with data: {data}'}, status=201)\n\n    def delete(self, request):\n        return JsonResponse({'message': 'DELETE request handled'}, status=204)\n<\/pre><p>Each method, such as <strong>get()<\/strong> and <strong>post()<\/strong>, is a separate function, making the logic clean and modular. If a method is not defined, Django responds with <strong>405 Method Not Allowed<\/strong> automatically.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>Django views are a powerful tool for processing requests and delivering responses. FBVs provide simplicity and control, ideal for smaller tasks, while CBVs offer structure and reusability, perfect for complex logic.<\/p><p>Understanding how to handle HTTP methods and customize views lets developers build efficient, scalable applications.<\/p><p>By leveraging Django&rsquo;s built-in tools like generic views and method dispatching, you can streamline project development, maintain clean code, and focus on creating great user experiences.<\/p><h2 class=\"wp-block-heading\" id=\"h-django-views-faq\">Django views FAQ<\/h2><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1732615349986\"><h3 class=\"schema-faq-question\">What&rsquo;s the difference between FBV and CBV in Django?<\/h3> <p class=\"schema-faq-answer\">FBVs are simple functions for handling HTTP requests, ideal for plain views. CBVs use object-oriented programming, offering inheritance and built-in tools for complex tasks like CRUD. FBVs are easier to learn but less reusable, while CBVs provide better structure and flexibility at the cost of a steeper learning curve.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1732615365786\"><h3 class=\"schema-faq-question\">When should I use FBVs over CBVs?<\/h3> <p class=\"schema-faq-answer\">Use FBVs for simple, one-off views with custom logic that don&rsquo;t align with standard CRUD patterns. They&rsquo;re ideal for API endpoints, webhook handlers, or unique page logic where simplicity and clarity are key. FBVs are also an excellent starting point for beginners learning Django&rsquo;s view system.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1732615370929\"><h3 class=\"schema-faq-question\">Can I customize generic views in Django?<\/h3> <p class=\"schema-faq-answer\">Yes, you can customize Django&rsquo;s generic views by overriding their built-in methods like <strong>get_queryset()<\/strong>, <strong>get_context_data()<\/strong>, or <strong>form_valid()<\/strong>. You can also add mixins for additional functionality or modify attributes, like <strong>template_name<\/strong>, <strong>model<\/strong>, and <strong>context_object_name<\/strong> to suit your specific needs.<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Django views are a key component of any web application, bridging your application&rsquo;s data and user interface. Once your Django [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/tutorials\/building-django-views\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":185,"featured_media":118890,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to use Django views","rank_math_description":"Learn about Django views, including function-based and class-based views, with examples and best practices to optimize your web application.","rank_math_focus_keyword":"django views","footnotes":""},"categories":[22646,22644],"tags":[],"class_list":["post-119345","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\/building-django-views","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/building-django-views","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/building-django-views","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/building-django-views","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/building-django-views","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/building-django-views","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/building-django-views","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/building-django-views","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts\/119345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/users\/185"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/comments?post=119345"}],"version-history":[{"count":10,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts\/119345\/revisions"}],"predecessor-version":[{"id":128694,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/posts\/119345\/revisions\/128694"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/media\/118890"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/media?parent=119345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/categories?post=119345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/tutorials\/wp-json\/wp\/v2\/tags?post=119345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}