My two cents: connection strings/database URI's are a feature I've sorely missed in Django.
Built-in functionality to convert environment variables like DJANGO_DB_DEFAULT (or more generally DJANGO_DB_*key*) into the relevant DATABASE setting would make some deployment situations a lot simpler. Currently, unless you use dj-database-uri you have to define a bunch of ad-hoc DB_USER/DB_PASSWORD etc env variables and price the dictionary together yourself. How does this library complex keys like OPTIONS, TEST or DEPENDENCIES? To help support third part backends: perhaps the scheme portion of the URI could be either a relative import from django.db.backends or an absolute import to a third party library? It seems URI schemes can have dots and underscores in them, so they can be python package paths. I.e sqlite3://xyz would resolve go django.db.backends.sqlite3, but sqlserver_ado://xyz would resolve to the third party django-mssql engine via an absolute import. Not sure how to handle arbitrary extra settings though. On 24 May 2017 19:05, "Kenneth Reitz" <m...@kennethreitz.org> wrote: > 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 > > https://code.djangoproject.com/ticket/28236 > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-developers+unsubscr...@googlegroups.com. > To post to this group, send email to django-developers@googlegroups.com. > Visit this group at https://groups.google.com/group/django-developers. > To view this discussion on the web visit https://groups.google.com/d/ms > gid/django-developers/057ced98-4471-4939-960b-900ec39f54b7%4 > 0googlegroups.com. > For more options, visit https://groups.google.com/d/optout > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAFNZOJPogT4y-E4v5giF-6ajbQ6PSpZvpAPZO0BzK%2BLT9uL1xA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.