Skip to content

Extract Django ORM into a Standalone Package #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
nndnha opened this issue Apr 26, 2025 · 5 comments
Open
1 task done

Extract Django ORM into a Standalone Package #6

nndnha opened this issue Apr 26, 2025 · 5 comments

Comments

@nndnha
Copy link

nndnha commented Apr 26, 2025

Code of Conduct

  • I agree to follow Django's Code of Conduct

Feature Description

I propose extracting Django's ORM and its migrations framework into a standalone Python package, similar to SQLAlchemy, to make it reusable outside the full Django framework.

Problem

This would allow developers to leverage Django's powerful ORM and migration tools in non-Django projects, fostering broader adoption and community contributions.

Request or proposal

request

Additional Details

No response

Implementation Suggestions

No response

Copy link

Thank you nndnha for sharing your idea! We have a lot of them so please be patient. You can see the current queue here. If you'd like to learn about other ways to get this idea more attention, please see this page.

Community instructions

For commenters, please use the emoji reactions on the issue to express support, and/or concern easily. Please use the comments to ask questions or contribute knowledge about the idea. It is unhelpful to post comments of "I'd love this" or "What's the state of this?"

Reaction Guide

  • 👍 This is something I would use
  • 👎 This is something that would cause problems for me or Django
  • 😕 I’m indifferent to this
  • 🎉 This is an easy win

@nanuxbe
Copy link
Contributor

nanuxbe commented May 1, 2025

Given this is a request and not a proposal and the general enthusiasm, would this happen to be a good candidate to flag as "sponsorable" feature?

@carltongibson
Copy link
Member

There's a long standing desire to make the ORM easier to use outside of a regular Django project. (Script usage for example.)

(I can't find a ticket for it right now 📱)

This is already do-able but you need to do things like configure the settings and such, which isn't always obvious. And it's not clearly documented.

Actually extracting the ORM looks like a very big lift. Maybe it's possible but the most likely outcome is a bit of preliminary investigation and then nothing. (Happy to be proven wrong.)

I'd suggest waypoints around the easing of allowing folks to use the ORM in scripts (non-web contexts) wouldn't be wasted effort. They'd be necessary anyway. Would be independently valuable. And may capture 90% of what's really wanted here anyway.

(I suspect there are few cases where it really matters that you get the bits of Django you're not using downloaded when you install Django for the bits you are using.)

@nanuxbe
Copy link
Contributor

nanuxbe commented May 2, 2025

@carltongibson do you think this (correct settings and other configuration to only use the ORM) could be achievable with the proposed new command as one of the proposed templates?

@carltongibson
Copy link
Member

@nanuxbe That's a good question. Maybe, yes.

I asked for a bit of input on patterns here:

https://fosstodon.org/@carlton/114437459643045544

(At the least we could document this up! 🫠)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Idea
Development

No branches or pull requests

3 participants