Computer Science

Computer Science

In this section, we explore the world of programming, algorithms, networks, and infrastructure

ProgrammingAlgorithmsComputer NetworksTechnologyInfrastructureSoftware EngineeringHardware Engineering

Related Categories

Featured Articles

Email Client Configuration & Dovecot Quota/Monitoring Guide for DirectAdmin Users

This guide explains how to configure popular email clients (iPhone Mail, Thunderbird, Gmail POP/SMTP), enable Dovecot LMTP quota warnings, and check the last login time for all email accounts on a DirectAdmin server. It includes step by step instructions, recommended IMAP/SMTP settings, and useful administrative scripts.

/article/email-client-configuration-dovecot-quotamonitoring-guide-for-directadmin-users

A Complete Guide to Installing and Setting Up Django

This article provides a comprehensive guide to installing and setting up Django. It covers installing Python, creating a virtual environment, installing Django with pip, configuring a database, and optional production setup using Apache and mod_wsgi. This guide is suitable for beginners as well as experienced developers.

/article/a-complete-guide-to-installing-and-setting-up-django

Understanding Django Models: Structure, Usage, and Database Integration

This article provides a clear and structured explanation of Django models, the core component responsible for defining and managing data in Django applications. It covers how models map to database tables, how fields are defined, how Django generates SQL automatically, and how to activate models within an application. A practical example is included to illustrate how models work in real projects.

/article/understanding-django-models-structure-usage-and-database-integration

Creating, Saving, and Querying Objects in Django: A Complete Guide to the ORM Query API

This article explains how Django’s ORM allows developers to create, retrieve, update, and delete objects using a powerful database‑abstraction API. It covers object creation, saving changes, working with ForeignKey and ManyToManyField relationships, retrieving objects using QuerySets, filtering data, chaining filters, and understanding how QuerySets behave. These concepts form the foundation of working with data in Django applications.

/article/creating-saving-and-querying-objects-in-django-a-complete-guide-to-the-orm-query-api

Aggregation and Annotation in Django ORM: Summaries, Counts, Averages, and Multi‑Aggregation Behavior

This article explains how Django ORM performs aggregation using aggregate() and annotate(), how to compute summary values such as counts, averages, minimums, and maximums, and how to generate per‑object summaries. It also covers common pitfalls when combining multiple aggregations, the use of distinct=True, and how to inspect SQL queries for debugging.

/article/aggregation-and-annotation-in-django-orm-summaries-counts-averages-and-multiaggregation-behavior

Search in Django ORM: From Basic Text Lookups to PostgreSQL Full‑Text Search

This article explores the different search techniques available in Django ORM—from simple text lookups using contains and icontains, to advanced database‑specific search features such as unaccent and trigram similarity in PostgreSQL. It also explains when traditional string matching becomes insufficient and how document‑based search engines or PostgreSQL’s built‑in full‑text search can be used for large‑scale and multilingual search needs.

/article/search-in-django-orm-from-basic-text-lookups-to-postgresql-fulltext-search

Understanding Managers in Django ORM: Custom Managers, Default Managers, Base Managers, and Advanced Usage Patterns

This article explains how Django Managers work, how to rename them, how to create custom managers, how to override get_queryset(), how default and base managers behave, how Django uses managers for related-object access, and how to expose custom QuerySet methods through a manager. Managers are the primary interface for database operations in Django, and understanding them is essential for writing clean, reusable, and powerful ORM logic.

/article/understanding-managers-in-django-orm-custom-managers-default-managers-base-managers-and-advanced-usage-patterns

Performing Raw SQL Queries in Django: RawSQL, raw(), Field Mapping, Parameters, and Safety Considerations

This article explains Django’s three mechanisms for executing raw SQL: embedding SQL fragments using RawSQL, using Manager.raw() to return model instances, and executing SQL directly. It covers field mapping, deferred fields, indexing behavior, parameterized queries, SQL injection protection, and backend-specific considerations such as MySQL’s type coercion. Raw SQL is powerful but must be used carefully and only when the ORM cannot express the required query.

/article/performing-raw-sql-queries-in-django-rawsql-raw-field-mapping-parameters-and-safety-considerations

Database Transaction Management in Django: atomic(), ATOMIC_REQUESTS, Savepoints, and Autocommit Behavior

This article explains how Django manages database transactions, including its default autocommit behavior, per-request transactions using ATOMIC_REQUESTS, explicit transaction control with atomic(), nested savepoints, durability guarantees, error handling patterns, and performance considerations. It also clarifies why Django uses autocommit by default and highlights common pitfalls such as catching exceptions inside atomic blocks or inconsistent model state after rollbacks.

/article/database-transaction-management-in-django-atomic-atomic-requests-savepoints-and-autocommit-behavior

Working with Multiple Databases in Django: Configuration, Migrations, Routing, and Database Routers

This article explains how Django supports multiple databases, including how to define database connections, run migrations on different databases, use management commands with database selection, and implement automatic database routing. It also covers the structure and behavior of database routers, how Django decides which database to use for reads, writes, relations, and migrations, and how hints influence routing decisions.

/article/working-with-multiple-databases-in-django-configuration-migrations-routing-and-database-routers

Using Tablespaces in Django: Table Storage, Index Placement, and Database Support

This article explains how Django supports tablespaces for organizing database storage. It covers how to declare tablespaces for tables and indexes, how DEFAULT_TABLESPACE and DEFAULT_INDEX_TABLESPACE influence behavior, and how tablespaces behave across different database backends. An example model demonstrates how table and index placement works in practice.

/article/using-tablespaces-in-django-table-storage-index-placement-and-database-support

Database Access Optimization in Django: Profiling, QuerySet Behavior, Indexing, and Efficient Query Techniques

This article provides a comprehensive guide to optimizing database access in Django. It covers profiling techniques, standard database optimizations such as indexing, understanding QuerySet evaluation and caching, using iterator() for large datasets, leveraging explain() for query analysis, and performing work inside the database rather than in Python. It also explores advanced techniques such as RawSQL and raw SQL execution.

/article/database-access-optimization-in-django-profiling-queryset-behavior-indexing-and-efficient-query-techniques