Technology · Framework

Django

Django and Django REST Framework in production, as used by Sifat Ali for SaaS backends, REST APIs, permissions, Celery jobs, WebSockets and Stripe billing.

What is Django?

Django is a high-level Python web framework that includes an ORM, database migrations, authentication, an admin interface and security protections by default. Django REST Framework (DRF) extends it with serializers, viewsets, authentication and permission classes for building REST APIs.

Official site: djangoproject.com

How I use Django

  • SaaS backends with authentication, roles and permissions
  • REST APIs with Django REST Framework serializers and viewsets
  • Stripe subscriptions and verified webhook endpoints
  • Real-time features over ASGI and WebSockets
  • Background processing with Celery and Redis
  • Admin tooling for operations teams

Why Django is my default for products

Django’s strength is that the decisions every product needs are already made well. The ORM and migrations keep the schema in code, the authentication and permission system is battle-tested, and the admin gives operations teams a working back office on day one. With Django REST Framework, the same models power a clean, documented API.

In my work, Django is where subscription billing, role-based permissions, third-party integrations and AI features come together. Long-running work moves to Celery, real-time features run over ASGI and WebSockets, and the whole application is served by Gunicorn or Uvicorn behind Nginx.

Habits that keep Django projects healthy

  • Business rules in services and model methods, not scattered across views
  • select_related and prefetch_related driven by real query counts
  • Permissions enforced in the API layer, tested per role
  • Settings from the environment, with manage.py check --deploy passing before release

Articles about Django

Frequently asked questions

What is Django REST Framework used for?

Django REST Framework is used to build REST APIs on top of Django. It provides serializers for validation and representation, generic views and viewsets for common endpoints, pluggable authentication, permission classes and a browsable API.

Can Django handle WebSockets?

Yes. Django runs on ASGI, and real-time features such as WebSockets are commonly built with Django Channels or a dedicated ASGI service, with Redis as the channel layer that lets multiple processes share messages.

Is Django a good choice for SaaS?

It is one of the strongest. Authentication, permissions, the ORM, migrations and the admin interface come built in, so effort goes into the product's own logic: billing, entitlements and features.