hackoregon / backend-examplar-2018

an example dockerized geo-aware django backend
MIT License
4 stars 5 forks source link

Running python manage.py test with -Wall option displays DeprecationError for psycopg2 #56

Open nam20485 opened 6 years ago

nam20485 commented 6 years ago

As recommended in Django Unit Testing instructions, I added the -Wall argument to python.exe in the python -Wall manage.py test command. When the production API image is built and the test-entrypoint.sh command is run, it now reports an error concerning psycopg2 being deprecated in favor of django.db.backends.postgresql:

$ bin/test.sh -p
Creating network "[secure]resiliencebackend_default" with the default driver
Postgres is up
/usr/local/lib/python3.6/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)
/usr/local/lib/python3.6/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)
/usr/local/lib/python3.6/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)
/usr/local/lib/python3.6/site-packages/django_db_geventpool/backends/postgresql_psycopg2/base.py:13: RemovedInDjango30Warning: The django.db.backends.postgresql_psycopg2 module is deprecated in favor of django.db.backends.postgresql.
  from django.db.backends.postgresql_psycopg2.base import CursorWrapper

Is it necessary for us continue to use the psycopg2 module to connect to postgres, or can we update to the official and recommended DB connector?

znmeb commented 6 years ago

I vote for updating but does it impact any other teams?

bhgrant8 commented 6 years ago

yeah, did not know psycog2 was depreciated. would agree to update

bhgrant8 commented 6 years ago

Looks like it was actually an alias since 1.9 so, should have 0 impact on projects, if we update:

https://docs.djangoproject.com/en/2.0/releases/2.0/#id1