Opened 17 months ago

Last modified 8 months ago

#28236 assigned New feature

Integrate dj-database-url into Django

Reported by: Kenneth Reitz Owned by: Tom Forbes
Component: Core (Other) Version: 1.11
Severity: Normal Keywords: settings, dj-database-url, database_url
Cc: jacobian@…, Tom Forbes Triage Stage: Someday/Maybe
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description

dj-database-url gives Django developers two main things:

  1. the ability to represent their database settings via a string (a-la sqlalchemy); very useful for environmnent variables and 12factor apps.
  2. it will automatically use the DATABASE_URL environment variable, if present.

I'm not sure if #2 is appropriate for Django Core (but it would be nice, as Gunicorn supports both PORT and WEB_CONCURRENCY), but I know #1 is perfect. This plan has previously been discussed (at a conference, DjangoCon EU in Zurich, long ago) and approved by JKM, before his role at Heroku, if that is helpful information.

I think this change would vastly improve the usability of Django, and would be an excellent and simple move for the project.

Many thanks for your consideration. <3

--
Kenneth Reitz

P.S. There is no "Settings" component in the issue tracker, that I can find.

Change History (6)

comment:1 Changed 17 months ago by Tim Graham

Summary: Integrate dj-database-url into Django CoreIntegrate dj-database-url into Django
Triage Stage: UnreviewedSomeday/Maybe
Type: UncategorizedNew feature

It's better to propose something like this on the DevelopersMailingList where it'll receive more feedback.

comment:2 Changed 17 months ago by Kenneth Reitz

Thanks! I'll like to this ticket there.

comment:4 Changed 17 months ago by Tom Forbes

I've made an initial PR: https://github.com/django/django/pull/8562

I copied most of the 'guts' of the library and fixed up all the tests.

I don't think this is anywhere near ready to merge, but I like the idea and I thought I would take the first step and propose one way to integrate the library.

comment:5 Changed 9 months ago by Tom Forbes

Cc: Tom Forbes added
Has patch: set

I've removed the WIP from my branch as I think the implementation is ready to be discussed. I've got all tests to pass and a mechanism for configuring both the caches and the databases via URLs.

comment:6 Changed 8 months ago by Tom Forbes

Owner: changed from nobody to Tom Forbes
Status: newassigned
Note: See TracTickets for help on using tickets.
Back to Top