Latest Senses

Published on May 5, 2023 by haradhansharma / django / ORM / database / optimizing /
When building a Django application, it's important to optimize database queries for performance. One way to do this is by using database indexing, which can speed up queries that filter or order by specific fields. In this post, we'll explore some best practices for using database indexing in Django.   What is database indexing? A database index is a data structure that enables fast retrieval of data based on the values in one or more fields. When you create an index…
126 views
Published on Oct. 15, 2022 by haradhansharma / cwp / contabo /
blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. blah blah. bla…
208 views
Published on May 5, 2023 by haradhansharma / django / ORM /
Django's ORM (Object-Relational Mapping) makes it easy to work with databases in Python, allowing developers to write database queries in a more Pythonic way. One of the most powerful features of Django's ORM is the QuerySet API, which provides a large number of methods for filtering, sorting, and manipulating data. However, using these methods efficiently can be challenging, especially for developers new to Django. In this post, we'll explore some best practices for using QuerySet …
150 views
Published on May 5, 2023 by haradhansharma / Python / django / ORM /
It is a Django's performance tuning guide using select_related and prefetch_related for Faster Queries Django is a popular web framework that provides a wide range of features to simplify the development of web applications. One of the most powerful features in Django is the ability to fetch related objects efficiently using select_related and prefetch_related. In this blog post, we'll take a closer look at these features and explore how they can help you optimize the perform…
260 views
Published on Jan. 21, 2023 by haradhansharma / Python / Cythonized / Cython /
We demonstrate how to convert Python modules into Cythonized ones in this sense. Typically, when using Cython, only a few selected modules of the program are Cythonized. Examining a very basic Python module that we could put in `wsgi.py`. import os import sys if os.name != 'nt': path = '/home/usr/public_html' python_path = '/home/user/env/lib/python3.9/site-packages' sys.path.append(path) sys.path.append(python_path) os.environ['DJANGO_SETTINGS_MODULE…
334 views