Django 3.0+ Uses deprecated postgresql_psycopg2 package
See original GitHub issueI’m getting this error
Traceback (most recent call last):
File "/Users/jesse.kleve/src/playgrounds/django/dori/api/venv/lib/python3.7/site-packages/django/db/backends/base/base.py", line 220, in ensure_connection
self.connect()
File "/Users/jesse.kleve/src/playgrounds/django/dori/api/venv/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/Users/jesse.kleve/src/playgrounds/django/dori/api/venv/lib/python3.7/site-packages/django/db/backends/base/base.py", line 197, in connect
self.connection = self.get_new_connection(conn_params)
File "/Users/jesse.kleve/src/playgrounds/django/dori/api/venv/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/Users/jesse.kleve/src/playgrounds/django/dori/api/venv/lib/python3.7/site-packages/django/db/backends/postgresql/base.py", line 185, in get_new_connection
connection = Database.connect(**conn_params)
File "/Users/jesse.kleve/src/playgrounds/django/dori/api/venv/lib/python3.7/site-packages/psycopg2/__init__.py", line 125, in connect
dsn = _ext.make_dsn(dsn, **kwargs)
File "/Users/jesse.kleve/src/playgrounds/django/dori/api/venv/lib/python3.7/site-packages/psycopg2/extensions.py", line 174, in make_dsn
parse_dsn(dsn)
psycopg2.ProgrammingError: invalid dsn: invalid connection option "init_command"
It seems to be using the wrong backend. It’s using 'django.db.backends.postgresql_psycopg2'
with DATABASE_URL='postgres://root:toor@127.0.0.1:5432/django'
.
This is with Django version 3.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:8 (1 by maintainers)
Top Results From Across the Web
'django.db.backends.postgresql_psycopg2' not working in ...
The django.db.backends.postgresql_psycopg2 module is deprecated in favor of django.db.backends.postgresql. It's been an alias since Django 1.9.
Read more >Django 3.0+ Uses deprecated postgresql_psycopg2 package
It seems to be using the wrong backend. It's using 'django.db.backends.postgresql_psycopg2' with DATABASE_URL='postgres://root:toor@127.0.0.1: ...
Read more >Django 3.0 release notes
We've dropped some features that have reached the end of their deprecation cycle, and we've begun the deprecation process for some features. See ......
Read more >How to Start Django Project with a Database(PostgreSQL)
Let's get started !! 1. Create a directory, and virtual environment. Create a project directory, in this case I use “django-postgres”.
Read more >django-deprecate-fields - PyPI
This package allows deprecating model fields and allows removing them in a ... Usage. Assume the simple following model: from django.db import models...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m running into the same issue at the moment. Any chance of a new release? As already mentioned, the current PyPI version (0.5.0) is still using the old behaviour, even though this is fixed on
master
.The new version https://pypi.org/project/dj-database-url/1.0.0/ is out on pypi, which includes the fix, so the issue can be closed.