Skip to content

Remove DATABASE_URL where possible - #4862

Merged
foarsitter merged 16 commits into
cookiecutter:mainfrom
foarsitter:remove_database_url
Jul 27, 2026
Merged

Remove DATABASE_URL where possible#4862
foarsitter merged 16 commits into
cookiecutter:mainfrom
foarsitter:remove_database_url

Conversation

@foarsitter

@foarsitter foarsitter commented Feb 15, 2024

Copy link
Copy Markdown
Collaborator

This is an attempt the remove DATABASE_URL environment variable.

The only use case where DATABASE_URL is required is when an application is hosted on heroku.

Fix #6273
Closes #6747
Close #6404

@foarsitter
foarsitter force-pushed the remove_database_url branch from 2b74919 to 7d899c2 Compare August 27, 2024 08:43
@foarsitter
foarsitter marked this pull request as ready for review August 27, 2024 08:44
@foarsitter foarsitter changed the title Remove DATABASE where possible Remove DATABASE_URL where possible Aug 27, 2024
@foarsitter
foarsitter requested review from browniebroke and removed request for browniebroke October 11, 2024 07:54

@browniebroke browniebroke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in principle, might be nice to see how it looks like after master is merged, as there was a few other changes

Comment thread {{cookiecutter.project_slug}}/.github/workflows/ci.yml Outdated
Comment thread docs/developing-locally.rst Outdated
Comment thread docs/developing-locally.rst Outdated
Comment thread {{cookiecutter.project_slug}}/config/settings/base.py Outdated
foarsitter and others added 4 commits October 14, 2024 20:42
Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
# Conflicts:
#	docs/2-local-development/developing-locally.rst
#	{{cookiecutter.project_slug}}/compose/production/django/Dockerfile
Comment thread {{cookiecutter.project_slug}}/.github/workflows/ci.yml Outdated

@browniebroke browniebroke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we replace this one too?

DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres"

@browniebroke
browniebroke force-pushed the remove_database_url branch from 31920ec to 696bdad Compare July 25, 2026 10:23
.venv/lib/python3.14/site-packages/environ/environ.py:756
  /home/runner/work/django_baked_dburl_2/django_baked_dburl_2/.venv/lib/python3.14/site-packages/environ/environ.py:756: UserWarning: Engine not recognized from url: {'NAME': '', 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': '', 'ENGINE': ''}
    warnings.warn(f'Engine not recognized from url: {config}')
@browniebroke
browniebroke force-pushed the remove_database_url branch from 696bdad to a527401 Compare July 25, 2026 10:25
@browniebroke

browniebroke commented Jul 25, 2026

Copy link
Copy Markdown
Member

@foarsitter I've rebased this and addressed a few issues I found during testing. If you have some time, it would be nice if you could cross check my latest changes.

No worries if you don't have time, though. I'll wait a few days and merge if I don't hear back from you.

Thanks for getting this started.

Comment thread {{cookiecutter.project_slug}}/config/settings/base.py Outdated
@foarsitter
foarsitter merged commit 2c60034 into cookiecutter:main Jul 27, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DATABASE_URL is exported in django container entrypoint but not available in container

2 participants