Skip to main content

Command Palette

Search for a command to run...

Custom Exception Handler In Django Rest Framework - Technostacks

Updated
12 min read
Custom Exception Handler In Django Rest Framework - Technostacks

Technostacks logo

Technostacks logo

Close

Get In TouchLink

Creating Custom Exceptions Using Django Rest Framework

Technostacks Avatar

Written by

###

Technostacks

Technostacks is a global IT solutions company specializing in AI, IoT, and SaaS, delivering innovative digital products for businesses.

Share with your community!

[

facebook

](https://www.facebook.com/sharer/sharer.php?u=https://technostacks.com/blog/custom-exception-handler-in-django-rest-framework/)[

X

](https://x.com/intent/tweet?url=https://technostacks.com/blog/custom-exception-handler-in-django-rest-framework/&text=Custom Exception Handler In Django Rest Framework)[

linkedin

](https://www.linkedin.com/sharing/share-offsite/?url=https://technostacks.com/blog/custom-exception-handler-in-django-rest-framework/)

Designing & Development

Custom Exception Handler In Django Rest Framework

01 Sep 2023

Exception handling is a crucial aspect of any web application, as it helps ensure that errors and unexpected situations are handled precisely.

In Django Rest Framework (DRF), a powerful and flexible toolkit for building Web APIs, you can create a custom exception handler to tailor error responses to your application’s needs.

In the current scenario, DRF is the de facto tool for creating REST APIs leveraing Django. It is a useful framework with effective functionalities.

In this blog post, we will explicitly create a custom exception handler that covers various exceptions and provides meaningful error messages to the clients.

We will even demonstrate the implementation of a custom exception handler with necessary code examples.

Understanding Django Rest Framework’s Exception Handling

Django Rest Framework (DRF) offers in-built exception handling that can be utilized to manage errors, mistakes, and exceptions in a RESTful API. Furthermore, exception handling in DRF allows you to intercept and customize how errors are presented to clients. By default, DRF provides a standard exception handler that formats exceptions into JSON responses.

However, it would help if you created a custom handler to tailor the error messages and structure to match your application’s requirements.

Read More:- Reasons to Choose Django For Web Development

Building a Custom Exception Handler

You can enable custom exception handling by building a handler function that transforms exceptions raised in the API views into response objects. This facilitates you to regulate the style of error responses utilized by the API. Let us build a custom exception handler with below explained steps.

Defining the Custom Exception Handler Function

Are you required to deal with and handle the exceptions yourselves? Here is how to do it better and precisely. To create a custom exception handler, first, you must define a function that takes two arguments: the exception (exc) and the context (context) in which the exception occurred.

The function will return an applicable error message. In our case, we will also include logic to handle different exceptions.

# exception_handler.py

from rest_framework.views import exception_handler from .make_response import response import logging logger = logging.getLogger('django')

def custom_exception_handler(exc, context): """ The function `custom_exception_handler` handles custom exceptions by mapping them to specific handlers and returning a response with the appropriate status code and message.

:param exc: The `exc` parameter is the exception object that was raised. It contains information about the exception, such as its type, message, and traceback :param context: The `context` parameter in the `custom_exception_handler` function is a dictionary that contains information about the current request and view that raised the exception. It typically includes the following keys: :return: a response object. """ try: exception_class = exc.__class__.__name__

handlers = { 'NotAuthenticated': _handler_authentication_error, 'InvalidToken': _handler_invalid_token_error, 'ValidationError': _handler_validation_error,

Add more handlers as needed

} res = exception_handler(exc, context) if exception_class in handlers:

calling hanlder based on the custom

message = handlers[exception_class](exc, context, res) else:

if there is no hanlder is presnet

message = str(exc)

return response(data={}, status_code=res.status_code, message=message) except Exception as e: logger.error(str(e))

... (other handler functions)

Handling Different Types of Exceptions

This section will showcase you how to handle three types of exceptions: NotAuthenticated, InvalidToken, and ValidationError. You can extend this pattern to handle added exceptions as required.

# exception_handler.py

... (import statements)

Existing handler functions

def _handler_authentication_error(exc, context, response): """ The function returns a message indicating that an authorization token is not provided.

:param exc: The `exc` parameter is the exception object that was raised during the authentication process :param context: The `context` parameter is a dictionary that contains additional information about the error that occurred. It can include details such as the request that caused the error, the user who made the request, or any other relevant information :param response: The `response` parameter is the HTTP response object that will be returned to the client. It contains information such as the status code, headers, and body of the response :return: the string "An authorization token is not provided." """ return "An authorization token is not provided."

def _handler_invalid_token_error(exc, context, response): """ The function handles an invalid token error by returning a specific error message.

:param exc: The `exc` parameter represents the exception that was raised. In this case, it would be an invalid token error :param context: The `context` parameter is a dictionary that contains additional information about the error that occurred. It can include details such as the request that caused the error, the user who made the request, or any other relevant information :param response: The `response` parameter is the HTTP response object that will be returned to the client. It contains information such as the status code, headers, and body of the response :return: the string "An authorization token is not valid." """ return "An authorization token is not valid."

def _handler_validation_error(exc, context, response): """ The function `_handler_validation_error` handles validation errors by extracting the error code and value, and returning a custom error message based on the code.

:param exc: The `exc` parameter is an exception object that is raised when a validation error occurs. It contains information about the error, such as the field that failed validation and the error code :param context: The `context` parameter is a dictionary that contains additional information about the exception that occurred. It can include details such as the request, view, and args that were being processed when the exception occurred :param response: The `response` parameter is the response object that will be returned by the handler. It is used to modify the response if needed :return: a message based on the validation error code. """ key = list(list(exc.__dict__.values())[0].keys())[0] try: code = list(list(exc.__dict__.values())[0].values())[0][0].__dict__['code'] value = list(list(exc.__dict__.values())[0].values())[0][0]

except: code = list(list(exc.__dict__.values())[0].values())[0][0][0].__dict__['code'] value = list(list(exc.__dict__.values())[0].values())[0][0][0]

custom_msg_code = ["required", "null", "blank"] if code in custom_msg_code: message = f"{key} field is required" elif code: message = f"{value}" return message

... (other handler functions)

By default, NotAuthenticated exception leads to a direct response through the HTTP status code “401 Unauthenticated.” However, it may even lead to a “403 Forbidden” response, as per the authentication scheme in practice.

The ValidationError class is fundamentally utilized for field-based validation, and by using validator classes. It is raised while you call for serializer.is_valid with explicit raise_exception keyword argument.

Read More:- Why Should You Choose Python for Web Development?

Implementing the Custom Exception Handler in Django

To integrate the custom exception handler into your Django project, you must update the DRF settings in your settings.py file.

# settings.py

... (other settings)

Configure the custom exception handler

REST_FRAMEWORK = { "EXCEPTION_HANDLER": "path.to.your.exception_handler.custom_exception_handler" }

... (other settings)

It is significant to note that you should only raise custom exceptions when the error is somewhat that the customer can do something about, for instance, when the customer has used invalid input or other unauthorized requests.

If the error is a server-side problem, like a database connection error, utilizing the built-in exception handling offered by DRF or Django is better.

Read More:- Reasons Why Choose Python As Your Next Web Project

There are several and diverse properties accessible for inspecting the status of an API exception. You can leverage these properties to create custom exception handling for your in-hand and futuristic technology projects.

Conclusion

Custom exception handling can be a commanding tool when leveraged rightly in a Django Rest Framework project. With it, you can offer more comprehensive and useful error messages to your API clients and enhance the user experience of your API.

This blog post explored creating a custom exception handler for Django Rest Framework. We learned how to define a custom exception handler function, handle different types of exceptions with meaningful error messages, and integrate the custom handler into a Django project.

Customizing your exception-handling logic allows you to provide more user-friendly and informative error messages to clients, enhancing the overall user experience of your API. By tailoring error responses to your application’s needs, you can effectively communicate issues and promote a smoother interaction between your application and its users.

Moving Forward with Django App Development

Technostacks is a leading python development company and our teams have a proven experience in working with Django applications. Contact us for your next Django app development project.

In this article

Resources

Expert insights to make you future-ready

View All ResourcesLink

Previous Post

Next Post

Have a question?

Let us know.

Contact UsLink

AWS Certified

Google Cloud Partner

Zoho Authorised Partner

ISO 27001:2013 Certificate

Nasscom Affiliation

Footer Background

Redefining challenges, transforming experiences.

Cutting edge-solutions for seamless change.

Career

hr@technostacks.com

+91 99097 12616

USA

18383 Preston Rd, #202
Dallas, TX 75252

+1 (510) 402-6022

info@technostacks.com

India

10th Floor, Sun Square, Navrangpura, Ahmedabad, Gujarat – 380006

+91 97129 55934

info@technostacks.com

© 2026 Technostacks. All rights reserved.

Instagram

LinkedIn

Twitter / X

{"prefetch":[{"source":"document","where":{"and":[{"href_matches":"/*"},{"not":{"href_matches":["/wp-*.php","/wp-admin/*","/wp-content/uploads/*","/wp-content/*","/wp-content/plugins/*","/wp-content/themes/techno-2025/*","/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]} function dnd_cf7_generateUUIDv4() { const bytes = new Uint8Array(16); crypto.getRandomValues(bytes); bytes[6] = (bytes[6] & 0x0f) | 0x40; // version 4 bytes[8] = (bytes[8] & 0x3f) | 0x80; // variant 10 const hex = Array.from(bytes, b => b.toString(16).padStart(2, "0")).join(""); return hex.replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/, "$1-$2-$3-$4-$5"); } document.addEventListener("DOMContentLoaded", function() { if ( ! document.cookie.includes("wpcf7_guest_user_id")) { document.cookie = "wpcf7_guest_user_id=" + dnd_cf7_generateUUIDv4() + "; path=/; max-age=" + (12 * 3600) + "; samesite=Lax"; } }); jQuery(document).ready(function($){ var skills = '[{"id":37,"tech":".Net","status":1,"isDeleted":0},{"id":192,"tech":"Accountant","status":1,"isDeleted":0},{"id":186,"tech":"AdMob","status":1,"isDeleted":0},{"id":139,"tech":"AES Encryption & Decryption","status":1,"isDeleted":0},{"id":159,"tech":"Agora.io","status":1,"isDeleted":0},{"id":169,"tech":"Amazon Rekognition","status":1,"isDeleted":0},{"id":5,"tech":"Android","status":1,"isDeleted":0},{"id":25,"tech":"AngularJs","status":1,"isDeleted":0},{"id":96,"tech":"Appium","status":1,"isDeleted":0},{"id":103,"tech":"ARCore","status":1,"isDeleted":0},{"id":91,"tech":"ARKit","status":1,"isDeleted":0},{"id":133,"tech":"Authorize.net","status":1,"isDeleted":0},{"id":93,"tech":"Automation Testing","status":1,"isDeleted":0},{"id":162,"tech":"AWS Amplify","status":1,"isDeleted":0},{"id":68,"tech":"AWS API GateWay","status":1,"isDeleted":0},{"id":167,"tech":"AWS CloudFormation","status":1,"isDeleted":0},{"id":66,"tech":"AWS CloudWatch","status":1,"isDeleted":0},{"id":170,"tech":"AWS CodeCommit","status":1,"isDeleted":0},{"id":70,"tech":"AWS CognitoPool","status":1,"isDeleted":0},{"id":60,"tech":"AWS EC2","status":1,"isDeleted":0},{"id":63,"tech":"AWS IAM","status":1,"isDeleted":0},{"id":102,"tech":"AWS IOT","status":1,"isDeleted":0},{"id":168,"tech":"AWS KMS","status":1,"isDeleted":0},{"id":67,"tech":"AWS Lambda","status":1,"isDeleted":0},{"id":116,"tech":"AWS lex","status":1,"isDeleted":0},{"id":61,"tech":"AWS Route53","status":1,"isDeleted":0},{"id":65,"tech":"AWS S3","status":1,"isDeleted":0},{"id":62,"tech":"AWS SES","status":1,"isDeleted":0},{"id":64,"tech":"AWS SNS","status":1,"isDeleted":0},{"id":164,"tech":"Azure Blob","status":1,"isDeleted":0},{"id":120,"tech":"Banner Design","status":1,"isDeleted":0},{"id":24,"tech":"BDE","status":1,"isDeleted":0},{"id":173,"tech":"Bitbucket","status":1,"isDeleted":0},{"id":31,"tech":"Blockchain Dev","status":1,"isDeleted":0},{"id":59,"tech":"Bootstrap CSS","status":1,"isDeleted":0},{"id":142,"tech":"BudgetSMS","status":1,"isDeleted":0},{"id":11,"tech":"Business Analyst","status":1,"isDeleted":0},{"id":15,"tech":"Business Development Executive","status":1,"isDeleted":0},{"id":40,"tech":"C++","status":1,"isDeleted":0},{"id":58,"tech":"CakePHP","status":1,"isDeleted":0},{"id":140,"tech":"Catchoom","status":1,"isDeleted":0},{"id":111,"tech":"CCIE","status":1,"isDeleted":0},{"id":109,"tech":"CCNA","status":1,"isDeleted":0},{"id":110,"tech":"CCNP","status":1,"isDeleted":0},{"id":172,"tech":"CircleCI","status":1,"isDeleted":0},{"id":22,"tech":"CodeIgniter","status":1,"isDeleted":0},{"id":32,"tech":"Content Writer","status":1,"isDeleted":0},{"id":89,"tech":"Core Data","status":1,"isDeleted":0},{"id":47,"tech":"CoreML","status":1,"isDeleted":0},{"id":119,"tech":"CRM","status":1,"isDeleted":0},{"id":9,"tech":"CSS","status":1,"isDeleted":0},{"id":118,"tech":"Data Analysis","status":1,"isDeleted":0},{"id":39,"tech":"Data Mining\/ Research","status":1,"isDeleted":0},{"id":30,"tech":"DevOps","status":1,"isDeleted":0},{"id":14,"tech":"Digital Marketing","status":1,"isDeleted":0},{"id":83,"tech":"Django Framework","status":1,"isDeleted":0},{"id":84,"tech":"Django REST Framework","status":1,"isDeleted":0},{"id":53,"tech":"Docker","status":1,"isDeleted":0},{"id":69,"tech":"DynamoDB","status":1,"isDeleted":0},{"id":80,"tech":"ECMA5","status":1,"isDeleted":0},{"id":81,"tech":"ECMA6","status":1,"isDeleted":0},{"id":82,"tech":"Elasticsearch","status":1,"isDeleted":0},{"id":185,"tech":"Email Automation","status":1,"isDeleted":0},{"id":184,"tech":"Email marketing","status":1,"isDeleted":0},{"id":21,"tech":"Embedded","status":1,"isDeleted":0},{"id":143,"tech":"Face Recognition","status":1,"isDeleted":0},{"id":123,"tech":"Fast API","status":1,"isDeleted":0},{"id":79,"tech":"Firebase","status":1,"isDeleted":0},{"id":158,"tech":"Flask","status":1,"isDeleted":0},{"id":137,"tech":"Flurry","status":1,"isDeleted":0},{"id":29,"tech":"Flutter","status":1,"isDeleted":0},{"id":26,"tech":"Frontend Dev","status":1,"isDeleted":0},{"id":19,"tech":"Fullstack","status":1,"isDeleted":0},{"id":171,"tech":"Github","status":1,"isDeleted":0},{"id":190,"tech":"GitLab","status":1,"isDeleted":0},{"id":147,"tech":"Google Map APIs","status":1,"isDeleted":0},{"id":183,"tech":"Google sheet API","status":1,"isDeleted":0},{"id":28,"tech":"Graphics Designer","status":1,"isDeleted":0},{"id":163,"tech":"GraphQL","status":1,"isDeleted":0},{"id":115,"tech":"Gulp-SASS","status":1,"isDeleted":0},{"id":20,"tech":"HR","status":1,"isDeleted":0},{"id":4,"tech":"HTML","status":1,"isDeleted":0},{"id":134,"tech":"InApp Purchase","status":1,"isDeleted":0},{"id":6,"tech":"iOS","status":1,"isDeleted":0},{"id":33,"tech":"IT Recruiter","status":1,"isDeleted":0},{"id":41,"tech":"Java","status":1,"isDeleted":0},{"id":2,"tech":"JavaScript","status":1,"isDeleted":0},{"id":100,"tech":"Jenkins","status":1,"isDeleted":0},{"id":175,"tech":"JIRA","status":1,"isDeleted":0},{"id":99,"tech":"JMeter","status":1,"isDeleted":0},{"id":165,"tech":"Joomla E-Commerce","status":1,"isDeleted":0},{"id":3,"tech":"jQuery","status":1,"isDeleted":0},{"id":180,"tech":"Jupyter Notebook (Python)","status":1,"isDeleted":0},{"id":42,"tech":"Kivy","status":1,"isDeleted":0},{"id":43,"tech":"KivyMD","status":1,"isDeleted":0},{"id":131,"tech":"KNET","status":1,"isDeleted":0},{"id":36,"tech":"Kotlin","status":1,"isDeleted":0},{"id":1,"tech":"Laravel","status":1,"isDeleted":0},{"id":44,"tech":"LiDAR","status":1,"isDeleted":0},{"id":113,"tech":"Linux-OS","status":1,"isDeleted":0},{"id":114,"tech":"Mac-OS","status":1,"isDeleted":0},{"id":101,"tech":"Machine Learning","status":1,"isDeleted":0},{"id":48,"tech":"Magento","status":1,"isDeleted":0},{"id":146,"tech":"MailChimp","status":1,"isDeleted":0},{"id":127,"tech":"Mango Pay","status":1,"isDeleted":0},{"id":92,"tech":"Manual Testing","status":1,"isDeleted":0},{"id":144,"tech":"Mapbox","status":1,"isDeleted":0},{"id":121,"tech":"Market Research","status":1,"isDeleted":0},{"id":188,"tech":"Marketing Sales Funnel","status":1,"isDeleted":0},{"id":97,"tech":"Maven","status":1,"isDeleted":0},{"id":18,"tech":"MEAN\/MERN Stack","status":1,"isDeleted":0},{"id":38,"tech":"MognoDB","status":1,"isDeleted":0},{"id":132,"tech":"Mollie","status":1,"isDeleted":0},{"id":55,"tech":"MySQL","status":1,"isDeleted":0},{"id":73,"tech":"NestJS","status":1,"isDeleted":0},{"id":107,"tech":"Network Design","status":1,"isDeleted":0},{"id":72,"tech":"NextJS","status":1,"isDeleted":0},{"id":13,"tech":"NodeJS","status":1,"isDeleted":0},{"id":85,"tech":"Numpy","status":1,"isDeleted":0},{"id":35,"tech":"Objective C","status":1,"isDeleted":0},{"id":46,"tech":"OpenCV","status":1,"isDeleted":0},{"id":86,"tech":"Pandas","status":1,"isDeleted":0},{"id":124,"tech":"PayPal","status":1,"isDeleted":0},{"id":130,"tech":"PayU","status":1,"isDeleted":0},{"id":128,"tech":"PayUMoney","status":1,"isDeleted":0},{"id":135,"tech":"PDF Generator","status":1,"isDeleted":0},{"id":23,"tech":"PHP","status":1,"isDeleted":0},{"id":160,"tech":"POLi Payments(NZ)","status":1,"isDeleted":0},{"id":56,"tech":"PostgreSQL","status":1,"isDeleted":0},{"id":12,"tech":"Project Manager","status":1,"isDeleted":0},{"id":90,"tech":"PubNub","status":1,"isDeleted":0},{"id":154,"tech":"PubNub","status":0,"isDeleted":0},{"id":138,"tech":"Push notification","status":1,"isDeleted":0},{"id":7,"tech":"Python","status":1,"isDeleted":0},{"id":17,"tech":"QA","status":1,"isDeleted":0},{"id":136,"tech":"QRCode Generator","status":1,"isDeleted":0},{"id":155,"tech":"QuickBlox","status":1,"isDeleted":0},{"id":156,"tech":"QuickBooks","status":1,"isDeleted":0},{"id":126,"tech":"Razorpay","status":1,"isDeleted":0},{"id":8,"tech":"React Native","status":1,"isDeleted":0},{"id":10,"tech":"ReactJs","status":1,"isDeleted":0},{"id":87,"tech":"RealityKit","status":1,"isDeleted":0},{"id":78,"tech":"Realm","status":1,"isDeleted":0},{"id":150,"tech":"Redis","status":1,"isDeleted":0},{"id":76,"tech":"Redux","status":1,"isDeleted":0},{"id":74,"tech":"Redux-saga","status":1,"isDeleted":0},{"id":75,"tech":"Redux-thunk","status":1,"isDeleted":0},{"id":166,"tech":"RoomDB (Android)","status":1,"isDeleted":0},{"id":189,"tech":"Scrum Master","status":1,"isDeleted":0},{"id":94,"tech":"Selenium IDE","status":1,"isDeleted":0},{"id":95,"tech":"Selenium WebDriver","status":1,"isDeleted":0},{"id":161,"tech":"Sendbird","status":1,"isDeleted":0},{"id":145,"tech":"Sendgrid","status":1,"isDeleted":0},{"id":187,"tech":"Sentry.io","status":1,"isDeleted":0},{"id":178,"tech":"Serverless","status":1,"isDeleted":0},{"id":179,"tech":"Shell Script","status":1,"isDeleted":0},{"id":49,"tech":"Shopify","status":1,"isDeleted":0},{"id":153,"tech":"Socket.io","status":1,"isDeleted":0},{"id":57,"tech":"SQLite","status":1,"isDeleted":0},{"id":149,"tech":"SSL Setup","status":1,"isDeleted":0},{"id":148,"tech":"SSO","status":1,"isDeleted":0},{"id":125,"tech":"Stripe","status":1,"isDeleted":0},{"id":174,"tech":"SVN","status":1,"isDeleted":0},{"id":34,"tech":"Swift","status":1,"isDeleted":0},{"id":71,"tech":"SwiftUI","status":1,"isDeleted":0},{"id":105,"tech":"Switches & Firewall Installation","status":1,"isDeleted":0},{"id":106,"tech":"Switching and Routing","status":1,"isDeleted":0},{"id":52,"tech":"Symfony","status":1,"isDeleted":0},{"id":129,"tech":"System Pay","status":1,"isDeleted":0},{"id":51,"tech":"Tailwind","status":1,"isDeleted":0},{"id":50,"tech":"Terraform","status":1,"isDeleted":0},{"id":98,"tech":"TestNG","status":1,"isDeleted":0},{"id":117,"tech":"Textract","status":1,"isDeleted":0},{"id":122,"tech":"threeJS","status":1,"isDeleted":0},{"id":108,"tech":"Troubleshooting","status":1,"isDeleted":0},{"id":141,"tech":"Twilio","status":1,"isDeleted":0},{"id":77,"tech":"Typescript","status":1,"isDeleted":0},{"id":27,"tech":"UI\/UX Designer","status":1,"isDeleted":0},{"id":88,"tech":"VisonKit","status":1,"isDeleted":0},{"id":45,"tech":"VueJs","status":1,"isDeleted":0},{"id":104,"tech":"WAN Networking","status":1,"isDeleted":0},{"id":151,"tech":"Web Socket","status":1,"isDeleted":0},{"id":112,"tech":"Windows-OS","status":1,"isDeleted":0},{"id":16,"tech":"Wordpress","status":1,"isDeleted":0},{"id":177,"tech":"Yii (PHP)","status":1,"isDeleted":0},{"id":157,"tech":"Zero Accounting","status":1,"isDeleted":0},{"id":152,"tech":"ZMQ","status":1,"isDeleted":0},{"id":191,"tech":"Zoom Meeting API","status":1,"isDeleted":0},{"id":181,"tech":"Zustand","status":1,"isDeleted":0}]'; skills = JSON.parse(skills); var skillsOptions = skills.map(function(item) { return { id: item.id, text: item.tech }; }); var skillselect = $('select[name=skill-set]'); $(skillselect).select2({ data: skillsOptions, multiple: true, placeholder: 'Select Skills' }); $(skillselect).on('change', function (e) { var skillsvalues = $(skillselect).select2('data'); var skillsetdeck = skillsvalues.map(function(skill){ return skill.id; }); $('#skill-set-deck').val(skillsetdeck.toString()); var skillsetemail = skillsvalues.map(function(skill){ return skill.text; }); $('#skill-set-email').val(skillsetemail.toString()); }); var min = $('#total-experience-element').attr('min'); var max = $('#total-experience-element').attr('max'); for(var i = min; i <= max; i++){ $('.ticks').append(''+i+''); } $('#total-experience-element').on('change', function () { $('#total-experience').val($(this).val()); }); }); if (navigator.platform.toUpperCase().includes('MAC')) { document.body.classList.add('is-mac'); } var technostacks_data = {"ajax_url":"https://technostacks.com/wp-admin/admin-ajax.php","site_url":"https://technostacks.com","plugin_url":"https://technostacks.com/wp-content/plugins/techno-2025-blocks"}; //# sourceURL=technostacks-js-extra ( function() { var skipLinkTarget = document.querySelector( 'main' ), sibling, skipLinkTargetID, skipLink; // Early exit if a skip-link target can't be located. if ( ! skipLinkTarget ) { return; } /* * Get the site wrapper. * The skip-link will be injected in the beginning of it. */ sibling = document.querySelector( '.wp-site-blocks' ); // Early exit if the root element was not found. if ( ! sibling ) { return; } // Get the skip-link target's ID, and generate one if it doesn't exist. skipLinkTargetID = skipLinkTarget.id; if ( ! skipLinkTargetID ) { skipLinkTargetID = 'wp--skip-link--target'; skipLinkTarget.id = skipLinkTargetID; } // Create the skip link. skipLink = document.createElement( 'a' ); skipLink.classList.add( 'skip-link', 'screen-reader-text' ); skipLink.id = 'wp-skip-link'; skipLink.href = '#' + skipLinkTargetID; skipLink.innerText = 'Skip to content'; // Inject the skip link. sibling.parentElement.insertBefore( skipLink, sibling ); }() ); //# sourceURL=wp-block-template-skip-link-js-after wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ 'ltr' ] } ); //# sourceURL=wp-i18n-js-after var wpcf7 = { "api": { "root": "https:\/\/technostacks.com\/wp-json\/", "namespace": "contact-form-7\/v1" }, "cached": 1 }; //# sourceURL=contact-form-7-js-before var dnd_cf7_uploader = {"ajax_url":"https://technostacks.com/wp-admin/admin-ajax.php","ajax_nonce":"1de1dff79d","drag_n_drop_upload":{"tag":"h3","text":"Drag & Drop Files Here","or_separator":"or","browse":"Browse Files","server_max_error":"The uploaded file exceeds the maximum upload size of your server.","large_file":"Uploaded file is too large","inavalid_type":"Uploaded file is not allowed for file type","max_file_limit":"Note : Some of the files are not uploaded ( Only %count% files allowed )","required":"This field is required.","delete":{"text":"deleting","title":"Remove"}},"dnd_text_counter":"of","disable_btn":""}; //# sourceURL=codedropz-uploader-js-extra var wpcf7r = {"ajax_url":"https://technostacks.com/wp-admin/admin-ajax.php"}; //# sourceURL=wpcf7-redirect-script-js-extra var wpcf7_recaptcha = { "sitekey": "6LetLXsqAAAAABCW2w554qT7XBtsqB-SyuEIf-Kg", "actions": { "homepage": "homepage", "contactform": "contactform" } }; //# sourceURL=wpcf7-recaptcha-js-before var ubermenu_data = {"remove_conflicts":"on","reposition_on_load":"off","intent_delay":"300","intent_interval":"100","intent_threshold":"7","scrollto_offset":"50","scrollto_duration":"1000","responsive_breakpoint":"959","accessible":"on","mobile_menu_collapse_on_navigate":"on","retractor_display_strategy":"responsive","touch_off_close":"on","submenu_indicator_close_mobile":"on","collapse_after_scroll":"on","v":"3.8.5","configurations":["main"],"ajax_url":"https://technostacks.com/wp-admin/admin-ajax.php","plugin_url":"https://technostacks.com/wp-content/plugins/ubermenu/","disable_mobile":"off","prefix_boost":"","use_core_svgs":"off","aria_role_navigation":"off","aria_nav_label":"off","aria_expanded":"off","aria_haspopup":"off","aria_hidden":"off","aria_controls":"","aria_responsive_toggle":"off","icon_tag":"i","esc_close_mobile":"on","keyboard_submenu_trigger":"enter","theme_locations":[]}; //# sourceURL=ubermenu-js-extra !function(e,n){if("undefined"!=typeof EnlighterJS){var o={"selectors":{"block":"pre.EnlighterJSRAW","inline":"code.EnlighterJSRAW"},"options":{"indent":4,"ampersandCleanup":true,"linehover":true,"rawcodeDbclick":false,"textOverflow":"break","linenumbers":true,"theme":"dracula","language":"generic","retainCssClasses":false,"collapse":false,"toolbarOuter":"","toolbarTop":"{BTN_RAW}{BTN_COPY}{BTN_WINDOW}{BTN_WEBSITE}","toolbarBottom":""}};(e.EnlighterJSINIT=function(){EnlighterJS.init(o.selectors.block,o.selectors.inline,o.options)})()}else{(n&&(n.error||n.log)||function(){})("Error: EnlighterJS resources not loaded yet!")}}(window,console); //# sourceURL=enlighterjs-js-after var technostacks_theme = {"ajax_url":"https://technostacks.com/wp-admin/admin-ajax.php","site_url":"https://technostacks.com","theme_url":"https://technostacks.com/wp-content/themes/techno-2025"}; //# sourceURL=techno-main-js-extra {"baseUrl":"https://s.w.org/images/core/emoji/17.0.2/72x72/","ext":".png","svgUrl":"https://s.w.org/images/core/emoji/17.0.2/svg/","svgExt":".svg","source":{"concatemoji":"https://technostacks.com/wp-includes/js/wp-emoji-release.min.js?ver=6.9"}} /*! This file is auto-generated */ const a=JSON.parse(document.getElementById("wp-emoji-settings").textContent),o=(window._wpemojiSettings=a,"wpEmojiSettingsSupports"),s=["flag","emoji"];function i(e){try{var t={supportTests:e,timestamp:(new Date).valueOf()};sessionStorage.setItem(o,JSON.stringify(t))}catch(e){}}function c(e,t,n){e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(t,0,0);t=new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data);e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(n,0,0);const a=new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data);return t.every((e,t)=>e===a[t])}function p(e,t){e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(t,0,0);var n=e.getImageData(16,16,1,1);for(let e=0;e{s[e]=t(o,e,n,a)}),s}function r(e){var t=document.createElement("script");t.src=e,t.defer=!0,document.head.appendChild(t)}a.supports={everything:!0,everythingExceptFlag:!0},new Promise(t=>{let n=function(){try{var e=JSON.parse(sessionStorage.getItem(o));if("object"==typeof e&&"number"==typeof e.timestamp&&(new Date).valueOf(){i(n=e.data),r.terminate(),t(n)})}catch(e){}i(n=f(s,u,c,p))}t(n)}).then(e=>{for(const n in e)a.supports[n]=e[n],a.supports.everything=a.supports.everything&&a.supports[n],"flag"!==n&&(a.supports.everythingExceptFlag=a.supports.everythingExceptFlag&&a.supports[n]);var t;a.supports.everythingExceptFlag=a.supports.everythingExceptFlag&&!a.supports.flag,a.supports.everything||((t=a.source||{}).concatemoji?r(t.concatemoji):t.wpemoji&&t.twemoji&&(r(t.twemoji),r(t.wpemoji)))}); //# sourceURL=https://technostacks.com/wp-includes/js/wp-emoji-loader.min.js (function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'9b88f6fd4d9e7a04',t:'MTc2NzUxMTEzNy4wMDAwMDA='};var a=document.createElement('script');a.nonce='';a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();

More from this blog

Binarydiods

272 posts