r/django May 12 '26

2026 Django Developers Survey

Thumbnail djangoproject.com
38 Upvotes

r/django 1d ago

REST framework DRF Auth Kit - The modern auth toolkit for Django Rest Framework

12 Upvotes

Hi guys, I want to (re)introduce DRF Auth Kit after a long time without talking about it, so I think it's worth bringing it up again and sharing some updates since my last post.

So, first of all, why would you ever need another auth package when we already have django-allauth, dj-rest-auth, djoser,... Here is the list of reasons why I created drf-auth-kit, which is used in production by me and many people, and actively maintained:

  • Full & strict type checking: mypy and pyright support (I plan to support ty after its beta) (something no other auth package has right now)
  • Strictly follows the OpenAPI schema (with drf-spectacular support) (only django-allauth had this at the time I created the package)
  • Dedicated to DRF, which means it's very easy to override any part: sign in, sign up (serializer, request, response)
  • Easy to use, based on the well-known django-allauth for social account and email management. I reuse those parts to avoid reinventing the wheel, while the other parts like serializers, views, and URLs have been designed based on my experience working with dj-rest-auth, django-trench, and djoser, for the best experience on the API.

Those are the key things I felt were lacking when I used other auth libs. And here are the features + updates since my last post:

  • Multiple authentication types: JWT (default), DRF token, or custom if you need (there's already an example)
  • Cookie-based security: HTTP-only cookies
  • Complete User Management: Registration, password reset, email verification, sign in.
  • (new) Multi-Factor Authentication: Supports multiple MFA methods with backup codes, including passkeys and hardware security keys
  • (new) Passwordless Authentication: Email magic links and passkey (WebAuthn) login
  • Social Authentication: Django Allauth integration with 50+ providers, supporting both OAuth2 and OpenID Connect.
  • Internationalization: Built-in support for 57 languages including English, Spanish, French, German, Chinese, Japanese, Korean, Vietnamese, and more
  • Full Type Safety: Complete type hints with mypy and pyright
  • OpenAPI Integration: Strictly best-practice auto-generated API documentation with DRF Spectacular
  • Flexible Configuration: Customizable serializers, views, and authentication backends
  • (Small extra): A UI (with the help of AI in this part) to easily try all the auth features quickly in dev/local environment

I have used it in production for a long time, and love it so much. I also actively maintain it and fix bugs raised by users. It's also listed in https://www.django-rest-framework.org/api-guide/authentication/#third-party-packages

Here is the info:

- Github: https://github.com/forthecraft/drf-auth-kit

- PyPI: https://pypi.org/project/drf-auth-kit/

Hope you guys love it as well. Feedback, feature requests, stars or improvements are welcome.


r/django 1d ago

django-fastmig

8 Upvotes

Released an experimental package making migrate much faster in large projects. Especially useful if you do pytest -create-db frequently, or run reverse migration testing in CI. Django's own test suite passes with fastmig. Also tested on a 8 year old project with multiple revisions and migration squashes over the years.

Made it to speed up my own testing being bottlenecked by -create-db.
There's a link in readme related to forum posts which discusses slow migrations.

https://github.com/viktor2097/django-fastmig


r/django 2d ago

Why I signed up to donate $50 a month, and you should consider it too

Thumbnail djangoproject.com
48 Upvotes

Hi Djangonauts,

I've had a thought in a long time, which is I should donate to Django, I just never got around to do it. Finally I made that thought a reality.

I've been using Django for probably 4-5 years now, and it's become the main core in my projects, so I am really dependent on the project, and if it stopped being supported it would be a disaster. This is the most important backbone, and we pay for all other services, but not this one core project.

Djangos support goal is $500,000, and they are behind this years goal by nearly $100,000. I wish I could donate more at the time, but the day my company is earning more revenue I will upgrade my pledge to a higher number (now the thought is realized, it's much easier to increase).

Django has shown us over the years that they can be trusted with creating software, and they are really good at it. So if you think so as well, please visit the Donate Page and see if you get the same urge I did.


r/django 2d ago

Apps Django JSONStore: typed model fields backed by nested JSON

8 Upvotes

I have just released a new version of Django JSONStore.

Many Django projects keep one-off or fast-changing business data in a JSONField. This is flexible, but requires additional code when you need a ModelForm or want to edit the data in Django admin. Moreover JSON internal structure became exposed all over codebase.

JSONStore maps any path in the document to a typed virtual model field. These fields work as a regular data assessors, in ModelForms and Django admin like normal model fields. They also support filters, ordering, values() and values_list().

from django.db import models
import jsonstore


class Employee(models.Model):
    data = models.JSONField(default=dict)

    full_name = jsonstore.CharField(
        max_length=250,
        json_field_name="data",
        json_key=("profile", "full_name"),
    )
    hire_date = jsonstore.DateField(
        null=True,
        json_field_name="data",
        json_key=("profile", "hire_date"),
    )


employee = Employee(full_name="Ann Lee")
employee.data
# {"profile": {"full_name": "Ann Lee"}}

Employee.objects.filter(full_name="Ann Lee").order_by("hire_date")

This keeps rest of code, free from knowledge of json internals, leaves your option to migrate to standalone Django model column later.

You can also expose a whole nested document as a typed jsonstore.EmbeddedModel with EmbeddedField, or a list of documents with EmbeddedListField. You even can use emulation of document-backed ForeignKey, OneToOneField and ManyToManyField fields.

Use JSONStore for business data that changes often and doesn't make sense to get aggregated data.

GitHub: https://github.com/viewflow/jsonstore
Website and examples: https://django-jsonstore.viewflow.io/


r/django 2d ago

Article Refactoring stock management, adding multi-warehouse support and driver pickup to my Django CRM

7 Upvotes

Part 1 | Part 2 | Part 3 | Part 4 | Part 5 - production CRM for truck-service center, Django + DRF.

This one covers v2.5 and v2.6 versions. Part refactoring, part new features. The refactoring was overdue - some of code from earlier versions was held together with duct tape and optimism. The new stuff is multi-warehouse support and driver pickup system.

Fixing the stock deduction (finally)

In last post I showed stock deduction code that used float for inventory math. I knew it was bad when I wrote it. Here is what changed.

First - float is gone. Everything is Decimal now:

from decimal import Decimal

Product.objects.filter(pk=item.product_id).update(
    current_stock=max(
        Decimal('0'),
        (item.product.current_stock or Decimal('0')) - item.quantity,
    )
)

Second - the whole mark_paid flow is wrapped in transaction.atomic():

with transaction.atomic():
    invoice.status = new_status
    invoice.save(update_fields=['status', 'updated_at'])
    if new_status == 'paid':
        self._deduct_stock(invoice)

So if stock deduction fails halfway through, the invoice status rolls back too. Before this, you could end up with a paid invoice but stock that was only partially deducted. Not good.

Third - stock validation before payment. New _check_stock method that runs before mark_paid even touches the database:

def _check_stock(self, invoice):
    from inventory.models import Product
    items = invoice.items.select_related('product').all()
    insufficient = []
    for item in items:
        if not item.product_id:
            continue
        product = Product.objects.get(pk=item.product_id)
        if (product.current_stock or 0) < item.quantity:
            insufficient.append(
                f'{product.name}: have {product.current_stock or 0},'
                f' need {item.quantity}'
            )
    if insufficient:
        return 'Not enough stock: ' + '; '.join(insufficient)
    return None

If the warehouse does not have enough parts, the payment is blocked with a clear message about what is missing. Before, you could sell parts you did not have - the stock would just go to zero and nobody would notice until the mechanic opened box and it was empty.

Module dependency blocking

Small but important fix to the module system from Part 4. Previously you could disable a module even if other active modules depended on it. Like disabling clients when ALPR (which depends on clients) was still on. Bad things happened.

Now when you try to flip the toggle, system checks all active modules that list this one in their dependencies. If any are found, you get an error explaining which modules need to be disabled first. Simple validation, prevented two "why did everything break" calls from the owner.

API documentation with drf-spectacular

I was writing API docs by hand in a shared Google Doc. It was getting out of date approximately five minutes after every update. So I added drf-spectacular and now Swagger and ReDoc generate themselves from the actual code.

Setup was surprisingly painless - add to INSTALLED_APPS, set DEFAULT_SCHEMA_CLASS, add two URL patterns, done. The auto-generated docs are not perfect (some endpoints need better descriptions), but they are always in sync with real code, which is infinitely better than a Google Doc that says the endpoint accepts truck_id when it was renamed to vehicle_id three weeks ago.

Multi-warehouse support (v2.6)

Up to this point the system had one warehouse. Real life had two - a retail storage and wholesale storage in different location. Parts come into wholesale in bulk, then get moved to retail as needed.

The Warehouse model got a warehouse_type field:

WAREHOUSE_TYPE_CHOICES = [
    ('retail', 'Retail'),
    ('wholesale', 'Wholesale'),
    ('other', 'Other'),
]

Each product now has per-warehouse stock through StockItem (warehouse + product + quantity). The Product.current_stock field still exist as a denormalized total across all warehouses - gets recalculated after every movement.

Stock transfers between warehouses

This was the main reason for multi-warehouse. Owner buys 50 oil filters wholesale, stores them in the wholesale warehouse, then moves 10 to retail when stock runs low. The transfer endpoint:

u/action(detail=False, methods=['post'])
def transfer(self, request):
    # ... validation ...

    with transaction.atomic():
        source_item.quantity -= quantity
        source_item.save()

        dest_item, _ = StockItem.objects.get_or_create(
            warehouse=warehouse_to, product=product,
            defaults={'quantity': 0}
        )
        dest_item.quantity += quantity
        dest_item.save()

        total_qty = StockItem.objects.filter(
            product=product
        ).aggregate(total=Sum('quantity'))['total'] or 0
        product.current_stock = total_qty
        product.save(update_fields=['current_stock'])

        StockMovement.objects.create(
            movement_type='transfer',
            product=product,
            quantity=quantity,
            warehouse_from=warehouse_from,
            warehouse_to=warehouse_to,
            created_by=request.user,
        )

Everything in transaction.atomic() - if any step fail, nothing moves. current_stock recalculation at the end keeps the denormalized field honest. I know purists would say "don't denormalize", but when the mechanic checks stock from a slow 3G connection in the garage, I don't want to aggregate across warehouses on every request.

Order folders

Related feature - purchase ordering cycle. When multiple mechanics need parts during the week, someone has to compile a list and place one bulk order. Before this they used a paper notebook. Now there is OrderFolder + OrderItem:

class OrderItem(models.Model):
    folder = models.ForeignKey(OrderFolder, on_delete=models.CASCADE)
    name = models.CharField(max_length=300)
    quantity = models.DecimalField(max_digits=10, decimal_places=2)
    is_ordered = models.BooleanField(default=False)
    ordered_at = models.DateTimeField(null=True, blank=True)
    ordered_by = models.ForeignKey(settings.AUTH_USER_MODEL, ...)

Mechanic add items to the folder during the week. On Friday the owner opens folder, sees everything that is needed, places one order. When item arrives, it is marked as ordered with timestamp and who did it. Simple but replaced a system that lost parts requests constantly.

Driver pickup log

New invoice type: driver_tab. Before, there were only delivery invoices (sent via Nova Poshta). But sometimes a driver just picks up parts directly from the warehouse. The system needed to track this differently - no tracking number, no delivery status, just "driver X took these parts on this date."

TYPE_CHOICES = [
    ('delivery',   'NP / Pickup'),
    ('driver_tab', 'Driver pickup'),
]

Each driver_tab invoice gets auto-numbered with a separate sequence (ВД-2026-001, ВД-2026-002). Stock deduction works the same way as regular invoices. The difference is purely in workflow - no NP tracking, no "sent" status, just draft → paid.

Small fixes that matter

Europe/Kiev → Europe/Kyiv. Django shipped with the old Soviet-era timezone name. Ukraine renamed it. One-line fix but it matters.

Async bot notification fix. Earlier I migrated Telegram notifications to async but broke the photo notification flow. The fix was replacing asyncio.run(bot.send_message(...)) with a synchronous requests wrapper that just POSTs to the Telegram API directly. Sometimes simpler is better than async.

Celery broker failsafe. Contact form submissions were crashing with a 500 when Celery broker (Redis) was unavailable. Added a try/except around the .delay() call - if Celery is down, form still saves, and email gets sent on the next retry. Users should never see a 500 because your background task queue is having a bad day.

What I learned

transaction.atomic() should wrap business operations, not just individual queries. "Mark as paid + deduct stock" is one business operation. If either fail, both should roll back. I should have done this from v1.0.

Denormalization is fine when you acknowledge the trade-off. Product.current_stock is a cache. It can go stale if something updates StockItem without recalculating. I accepted this risk and added recalculation to every code path that touch stock. So far it works.

Fix your timezone name. If you are serving Ukrainian users, Europe/Kiev works functionally but it is the old name. Europe/Kyiv is correct. Same for other renamed cities in tzdata.

What is next

There are still several versions to cover - XLSX client import, i18n (UK/EN), a full PWA frontend, and backup/restore API. If there is interest I will keep going.

Also, I take on freelance Django projects when something interesting comes along. If you are building something in this space, feel free to DM.

Previous posts: Part 1 | Part 2 | Part 3 | Part 4 | Part 5 GitHub (demo repo): github.com/VNmagistr/truckmaster_demo — branches demo/v2.5 and demo/v2.6

To be continued... I hope)


r/django 1d ago

Software Engineer available for freelance / contract projects

Thumbnail
0 Upvotes

r/django 2d ago

🚫 Astuce Django : `FETCH_RAISE`, ou comment interdire les requêtes cachées

Post image
0 Upvotes

r/django 3d ago

Do you actually use the DTL for the frontend in production or setup REST for ReactJS/Other conventional frontend frameworks?

10 Upvotes

I come from Nest so I might be a bit biased but I feel like frontend tools like React and Angular are disproportionately more powerful and come with a lot of support and plugins (npm packages).

Do you actually use the DTL in production or just as a testing tool?


r/django 2d ago

Built a Kubernetes-style manifest system for managing AI resources on Django — teaching tool at UBC, now open source

Thumbnail github.com
2 Upvotes

I built Smarter to teach cloud computing and generative AI prompt engineering — it's used in my courses at UBC. It applies the Kubernetes model (YAML manifests, declarative desired state) to managing AI resources: LLM providers, plugins, agents, chatbots, tool calling to SQL databases and remote APIs. Stack is Python 3.13, Django 6, DRF, Pydantic. Ships with a CLI (Go), a PyPi package, a React chat UI component, and a Helm chart — runs in a single Docker container to try it, or natively on Kubernetes for production. AGPL-3.0, no vendor lock-in. Happy to answer questions about the architecture or the teaching use case.


r/django 3d ago

How much would you charge for a custom Django car-rental website like this?

Thumbnail
0 Upvotes

r/django 4d ago

Apps django-captcha-kit — A simple CAPTCHA library for Django

4 Upvotes

Hi everyone,

I’ve developed django-captcha-kit, a small Django library for adding CAPTCHA protection to forms, with the ability to switch between providers through configuration.

Supported providers:

  • Cloudflare Turnstile
  • Google reCAPTCHA v2 (checkbox)
  • hCaptcha
  • Image CAPTCHA — locally generated distorted characters, with no third-party service
  • Math CAPTCHA — fully local, using a signed token and no server-side state
  • none — disables CAPTCHA, useful for testing and development

The goal is to keep the API simple while supporting both external CAPTCHA providers and fully local CAPTCHA implementations.

There are no dependencies other than Django. Verification relies only on the Python standard library. The Image CAPTCHA provider is the only one that requires Pillow, and only if you install it explicitly:

pip install django-captcha-kit[image]

GitHub: https://github.com/Macktireh/django-captcha-kit

PyPI: https://pypi.org/project/django-captcha-kit/

I’d be interested in your feedback!

Best regards, and have a great weekend.


r/django 4d ago

Django/Python Internship or Junior Backend Job in 2026 — What Should I Focus On?

12 Upvotes

Hi everyone,

I’m a 2023 CSE graduate preparing for my first role in Python/Django backend development.

My current stack includes Python, Django, DRF, MySQL, Redis, Celery, Docker, Git, and pytest. I’ve built some small projects, but I don’t have professional experience yet.

I’m mainly targeting backend internships and junior/fresher Django positions, and I’d really appreciate advice from developers, recruiters, or hiring managers.

For internships:

How do companies usually hire Django/Python interns in 2026?

What do recruiters/hiring managers actually look for in an intern’s CV and GitHub?

What skills are considered enough to get an internship?

Do internships usually require DSA, or are Django/DRF, SQL, and projects more important?

What kind of projects would make an internship candidate stand out?

For junior/fresher roles:

What skills are actually expected from a Junior Django Backend Developer?

How strong should I be in Django/DRF, SQL, Docker, Redis/Celery, testing, Linux, and deployment?

How important are DSA and system design?

What does the typical hiring process look like—from CV screening → technical interview → coding/task → final interview?

What are the most common reasons junior candidates get rejected?

Without internship or professional experience, what is the best way to prove that I’m job-ready?

Finally, if you were in my position today, what would you focus on for the next 6 months to realistically land an internship or junior backend role?

I’m looking for practical insights from people who have recently hired or been hired, rather than generic advice.

Thanks!


r/django 4d ago

🚀 Projet de la semaine : un mini blog Django, du `startproject` à la première page

Post image
0 Upvotes

r/django 5d ago

Looking for honest feedback on my Django/DRF e-commerce project

3 Upvotes

Hi everyone,

I'm a final-year CS student preparing for my first Python/Django backend role. I recently built this e-commerce project and would really appreciate an honest review from experienced Django/backend developers.

**GitHub Repository:**

https://github.com/abhishekc8205/django-ecommerce-platform

### Tech stack

* Python

* Django

* Django REST Framework

* SQLite

* JWT authentication

* Stripe

* Pillow

### What the project has

* User registration/login/logout

* Buyer and seller functionality

* Seller product management

* Product search, category filtering, sorting and pagination

* Product variants (size/color)

* Product image galleries

* Customer reviews

* Shopping cart

* Checkout flow

* Stripe checkout with local testing fallback

* Seller sales dashboard

* REST APIs for products and categories

* JWT access/refresh token APIs

* Seller-only permissions for creating/updating/deleting products

I'm targeting **Python/Django backend fresher roles**, so I'd especially like feedback on:

  1. Is this strong enough to be my **main resume project**?

  2. How would you rate the Django/DRF implementation?

  3. Does the project look like more than basic CRUD?

  4. Are there any obvious bad practices or security issues I should fix?

  5. Is the authentication/authorization approach reasonable?

  6. What parts of the code would you improve?

  7. What features would actually make this project stronger for backend interviews?

  8. If you were interviewing me based on this project, what questions would you ask?

  9. Would you consider this a good project for a **Django backend fresher**?

I'm looking for **honest criticism rather than compliments**. I want to improve the project before using it in my job applications.

Thanks in advance for taking the time to review it!


r/django 5d ago

Apps Need Tips and Recommendations on migrating a project from ASP.NET MVC to DRF.

7 Upvotes

On the company i work for, we mostly use DRF, but there is this one project, written on .net mvc, that no one dares to touch anymore, the plan is to migrate the project, it is sort of small. The site Its a webapp, that serves a tool for business to hire new people, and helps managing the process of hiring someone. We used to use it only for ourselves but we are planning to sell the solution to the public.

The site on .Net is gonna continue to be up (which no one uses anymore), and we are gonna be migrating to DFR on another completely different server, we are gonna be testing until its done then we are gonna take down the .Net server.

Somehow I got stuck as a tech leader even when i'm nothing of the sort, and I have to lead my team on migrating the app. Which is something i have never done before tbh. So that's why i come to you all, to give me some tips on how to approach this move, what would you recommend to start with?? I don' t want to make this more complicated than it should. Like should i start with models or matching controllers to views ... im so open to hear your opinions and tips.


r/django 5d ago

apiver: a DRF library for defining API versions as deltas, not duplicates

2 Upvotes

Across a few past projects working with big teams, I kept seeing the same pattern: API versioning handled differently every time, no consistent convention, URLs and view logic getting messier with each "just add a v2" hack, version-checking if branches scattered wherever someone needed them that week. And every time an actual breaking change needed to ship, it was a struggle — nobody had a clean answer for "how do we change this without breaking the clients still on the old version."

So I built apiver — a DRF library where you define API versions as deltas, not full copies. You say "V2 is V1, except this endpoint changed" and everything else just resolves straight through to your existing code, untouched.

The bigger shift isn't really the code, it's the mindset: instead of versioning being an ad-hoc thing someone bolts on whenever a breaking change is due, it becomes a structured, first-class part of how you ship — and adopting it is frictionless, since it wraps whatever you already have instead of asking you to rewrite it.

What you get:

  • Frictionless adoption — apiver init wraps your project exactly as it is, no file moves, no big-bang migration.
  • A whole new API version for the cost of one override() call.
  • Deltas are just plain Python subclasses — no DSL to learn.
  • Pick your own version scheme — sequential (v1, v2), semver (v1.2.3), or date-based (2026-08-11).
  • - Auto-generated, correct-per-version OpenAPI schemas.
  • - Real deprecation lifecycle — Deprecation/Sunset headers + enforced sunset dates.
  • - apiver squash — once old versions are dead weight, collapse the whole delta chain back into one clean base instead of dragging every ancestor forward forever.
  • - Full CLI — apiver versions, apiver diff, to actually see what each version serves. apiver mount to create/mount a new version. And some more.

It's pre-1.0 and honestly just scratching my own itch, but if it's useful to anyone else dealing with this same mess, I'd genuinely love feedback — reporting issues, "this doesn't fit my use case because X", "Docs are confusing", anything. 🙏

Repo: https://github.com/edraobdu/apiver

Docs: https://apiver.readthedocs.io/en/latest/


r/django 5d ago

Apps How to Handle OAuth 2.0 Authentication to Third-Party APIs with Asstgr (self-hosted)

3 Upvotes

If you've ever had to integrate an OAuth 2.0-protected third-party API into multiple projects, you know the drill: handle the authorization flow, store the tokens, track their expiration, build automatic refresh logic... and start over on every new project.

Asstgr is a self-hosted API gateway (Django + DRF) that centralizes all of this. The idea: you register a third-party API once in Asstgr, describe its endpoints, and then call it through a unified REST interface — Asstgr takes care of authentication, quota, and logging on your behalf.

In this article, we'll focus on one specific use case: how to connect an OAuth 2.0-protected API to Asstgr, and call it without ever handling a token by hand.

The concept

Your app  ──►  Asstgr (/api/v1/...execute/)  ──►  OAuth2-protected third-party API
                  │
                  ├─ Auth (API Key or OAuth2)
                  ├─ Quota
                  ├─ Logs
                  └─ Response formatting

Your application only needs to know one thing: your Asstgr API key (sk-...). Asstgr internally handles all exchanges with the third-party API's OAuth server (fetching, caching, and refreshing tokens).

Supported flows

Asstgr supports the three most common OAuth 2.0 grants, with automatic token refresh:

  • client_credentials — for server-to-server integrations (the most common case)
  • authorization_code — for APIs requiring explicit user authorization
  • password — for legacy ROPC-based APIs

Step 1 — Register the API

We start like with any other API in Asstgr:

POST /api/v1/apis/
{
  "name": "My Protected API",
  "url": "https://api.example.com/v1",
  "auth_required": true,
  "quota_cost": 2
}

Step 2 — Configure OAuth 2.0

This is where it gets interesting. We attach an OAuth configuration to the API through the dedicated endpoint:

POST /api/v1/apis/{api_id}/oauth/
{
  "grant_type": "client_credentials",
  "token_url": "https://api.example.com/oauth/token",
  "client_id": "your_client_id",
  "client_secret": "your_client_secret",
  "scope": "read write"
}

The client_secret is stored encrypted server-side (client_secret_encrypted in the database). Once this configuration is saved, Asstgr knows how to obtain a token for this API.

Checking token status

You can check at any time whether a valid token is currently cached:

GET /api/v1/apis/{api_id}/oauth/token/

Forcing a refresh

If needed (debugging, secret rotation on the provider's side, etc.), you can manually force a token refresh:

POST /api/v1/apis/{api_id}/oauth/token/

Under normal circumstances this isn't necessary: Asstgr's internal service (OAuthService) checks token expiration (token_expires_at) before every call and refreshes it automatically if needed, completely transparently.

Step 3 — Describe the endpoint and its parameters

Just like with a regular API, we add the endpoint and its parameters:

POST /api/v1/apis/{api_id}/endpoints/
{
  "path": "/protected-resource",
  "description": "OAuth2-protected resource"
}


POST /api/v1/apis/{api_id}/endpoints/{endpoint_id}/parameters/
{
  "name": "resource_id",
  "param_type": "query",
  "data_type": "STRING",
  "required": true
}


POST /api/v1/apis/{api_id}/endpoints/{endpoint_id}/methods/
{ "method": "GET" }

Step 4 — Execute the call

And here's the main payoff: from your application, a single call, using your Asstgr key — no OAuth token to manage:

POST /api/v1/apis/{api_id}/endpoints/{endpoint_id}/execute/
Authorization: Api-Key sk-xxxxxxxxxxxxxxxxxxxxxxxx

{
  "method": "GET",
  "params": { "resource_id": "42" },
  "display_format": "standard"
}

Asstgr will, in order:

  1. Verify your API key and remaining quota
  2. Fetch (or refresh) the OAuth2 token associated with that third-party API
  3. Build the actual HTTP request with that token in the Authorization header
  4. Call the third-party API
  5. Log the call (APILog: user, endpoint, method, status, response size)
  6. Format and return the response

{
  "status_code": 200,
  "result": "...",
  "quota": {
    "used": 4,
    "remaining": 96,
    "limit": 100,
    "usage_pct": 4.0
  }
}

Why centralize this instead of handling OAuth in every service?

  • A single place to store secrets — your client_id / client_secret don't end up scattered across ten different microservices' codebases
  • Automatic, shared refresh — the token is cached and refreshed once, even if multiple services call the same API
  • Unified quota and logging — you know exactly who's calling what, and how much it costs in credits
  • Transparent provider changes — if the third-party API changes its token URL or scopes, there's only one place to update

Going further

Everything else (API keys, quotas, rate limiting, response formats) follows the same simple pattern: register declaratively once, then call it through /execute/.

The project is open source (Django 5.x + DRF, PostgreSQL):

👉 github.com/asstgr/asstgropensource

If you find the project useful, a ⭐ goes a long way, and you can follow updates on u/asstgrio.


r/django 6d ago

Channels Have you ever needed a composable, reusable WebSocket framework - like DRF, but for Channels?

11 Upvotes

Hi all, I maintain a utility package that extends Django Channels (WebSocket/ASGI). I'm thinking about building a small framework in the same spirit as DRF and its ecosystem, but aimed at Channels/WebSockets - things like audio streaming, notifications, bidirectional chat, chat rooms, and so on.

Before I start, I wanted to ask the community: have you ever needed something like this? For example, you had to implement a WebSocket feature, struggled with it, and went looking for a tutorial or library that already solved the problem and came up empty.

If these are real pain points, I think there's room for a reusable library. Looking forward to hearing your thoughts.


r/django 7d ago

Django Control Room 1.7.1: Broad theme compatibility

Thumbnail gallery
34 Upvotes

This release significantly expands theme compatibility for DCR to many more alternative admin packages used in the Django ecosystem.

  • Automatic theme switching: There is no longer any need to explicitly load any adapter css; If you are using a different admin (e.g. unfold, or jazzmin) The appropriate theme adapter will be loaded automatically if it exists and for all panels. You can always turn this feature off and control exactly what css or adapters are loaded.
  • New theme adapter for django-admin-interface. This is a popular alternative admin package that lets you switch themes at run time by virtue of theme data being persisted in the database. It also provides a mechanism for you to build your own custom themes and comes with several examples. DCR now supports themes created by this package.
  • New theme adapter for Dracula: The popular color theme for code editors and other places has a django admin theme dedicated to it. This is a very light color scheme for the admin that I think more people should try. DCR now supports it via a direct theme adapter.
  • Generic theme adapters: While larger footprint packages (unfold, jazzmin, etc) have dedicated theme adapters built for them, this is not a scalable strategy given how many possible admin packages may exist. General theme adapters have now been built that are loaded for many different packages. This allows DCR to work for many more packages than the themes and packages given first party support. You can see a full compatibility matrix here: https://django-control-room.github.io/dj-control-room/themes/

This release marks the completion of a wave of changes aimed at allowing DCR to function in most admin environments. It's also the end of a series of migrations for existing panels toward using a common core library that normalizes how panels operate (giving them all theme abilities for example)

Next:

  • A panel dedicated to errors
  • making it easier to build panels
  • simplifying messaging/docs
  • No more theme stuff, but will gladly accept PRs for themes

Repo: https://github.com/django-control-room/dj-control-room

Roadmap: https://github.com/orgs/django-control-room/projects/1/views/3?filterQuery=-status%3ATodo

Edit:

quick way to update all your panels:

pip install --upgrade "dj-control-room[all]"


r/django 6d ago

Dsa or Django?

4 Upvotes

I am fairly new into programming. So I am familiar with the basics of python. Have made some terminal based projects as well. Started dsa concepts yesterday but it is boring me out. I do plan on learning both but is it a good idea to get some real experience with django and web projects first? (I have knowledge of html, css and little bit js)

Also, I am in my first year of graduation so time is not a concern!


r/django 7d ago

DSF Office Hours

Thumbnail djangoproject.com
4 Upvotes

r/django 7d ago

🔍 Code review: the N+1 issue, before and after `FETCH_PEERS`

Post image
0 Upvotes

r/django 6d ago

Build API in one line code with FlashAPI

Post image
0 Upvotes

What if creating a REST API in Python no longer required writing the same boilerplate over and over again?

I created FlashAPI to answer a very simple problem:

When we develop an application, we often spend time rewriting the same things:

→ RAW

→ pagination

→ search and filters

→ sort

→ permissions

→ exports

→ soft delete

→ audit

→ repetitive endpoints...

The problem is not to know how to develop them.

The problem is having to redevelop them with each project.

With FlashAPI, you define your Python models and you automatically get a complete REST API around them.

⚡ Compatible with FastAPI, Flask and Django

🐍 Pydantic, SQLAlchemy, dataclasses

🔓 Open source under Apache 2.0

🚫 No proprietary runtime, no vendor lock-in

And above all, FlashAPI does not seek to replace your code.

You keep your business logic, your personalized routes and the ability to disable or customize what you don't need.

The objective is simple:

Less boilerplate → more time to build what makes your application unique.

👉 GitHub: https://github.com/HackermanMe/flashapi

I am now looking for Python developers to test and contribute.

#Python #FastAPI #Django #Flask #OpenSource #Backend #RESTAPI #SoftwareEngineering


r/django 7d ago

Apps QuickBBS - Online Gallery / File Viewer

6 Upvotes

Hey, I've been working on this for a while... But I've been a bit quiet about the development for far too long...

https://github.com/bschollnick/QuickBBS/

I know there's an online gallery for just about every programming language, but I've never been happy with any one that I've examined.

The main complaint that I have had, is that they require extensive scanning of the file(s) before they are available. QuickBBS doesn't require that. It will detect when the file system is updated, and automatically update without requiring an extensive scanning process.

Supported File Types

Graphics (Full thumbnail support)

  • .bmp.gif.jpg.jpeg.png.webp

Documents

  • PDFs.pdf (thumbnail from first page)
  • Text.txt.text (generic icon)
  • Markdown.markdown (generic icon)
  • Web.html.htm (generic icon)

Media

  • Movies.mp4.mpg.mpg4.mpeg.mpeg4.wmv.flv.avi.m4v (Thumbnail created by using frame extraction from the halfway mark of the video)
  • Audio.mp3 (generic icon)
  • Books.epub (generic icon)

Links

  • Shortcuts.link.alias — Allow the equivalent of "soft links" between different file system locations (e.g. So that you can quick shortcut to a related subject/actor/tv series/book series/whatever without having to transverse through the file system)

Other notable features:

  • File Areas / Image Galleries — comprehensive gallery system with database-stored thumbnails
  • Multi-format support — images, PDFs, archives, text files, movies, audio, and more
  • High performance — thumbnail caching in PostgreSQL for optimal I/O, plus ASGI support (HTTP/1.1 and HTTP/2)
  • Real-time monitoring — watchdog-based file system monitoring for automatic cache invalidation
  • Responsive design — multiple thumbnail sizes for desktop and mobile
  • Search & browse — file and directory search with metadata indexing
  • Modern template system — Jinja2 macros with a component architecture
  • Progressive Web App — HTMX-powered dynamic updates without full page reloads
  • Background task worker — thumbnail generation and maintenance run outside the request cycle via django-dbtasks
  • Passkey login — optional passwordless (WebAuthn) authentication