Skip to content

Commit

Permalink
Merge pull request #4421 from Andrew-Chen-Wang/patch-7
Browse files Browse the repository at this point in the history
Change psycopg2 to psycopg3
  • Loading branch information
foarsitter authored Jun 29, 2023
2 parents 9e54d40 + 9a74e45 commit 4ef180e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ python << END
import sys
import time
import psycopg2
import psycopg
suggest_unrecoverable_after = 30
start = time.time()
while True:
try:
psycopg2.connect(
psycopg.connect(
dbname="${POSTGRES_DB}",
user="${POSTGRES_USER}",
password="${POSTGRES_PASSWORD}",
host="${POSTGRES_HOST}",
port="${POSTGRES_PORT}",
)
break
except psycopg2.OperationalError as error:
except psycopg.OperationalError as error:
sys.stderr.write("Waiting for PostgreSQL to become available...\n")
if time.time() - start > suggest_unrecoverable_after:
Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.project_slug}}/requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Werkzeug[watchdog]==2.3.6 # https://github.com/pallets/werkzeug
ipdb==0.13.13 # https://github.com/gotcha/ipdb
{%- if cookiecutter.use_docker == 'y' %}
psycopg2==2.9.6 # https://github.com/psycopg/psycopg2
psycopg[c]==3.1.9 # https://github.com/psycopg/psycopg
{%- else %}
psycopg2-binary==2.9.6 # https://github.com/psycopg/psycopg2
psycopg[binary]==3.1.9 # https://github.com/psycopg/psycopg
{%- endif %}
{%- if cookiecutter.use_async == 'y' or cookiecutter.use_celery == 'y' %}
watchfiles==0.19.0 # https://github.com/samuelcolvin/watchfiles
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-r base.txt

gunicorn==20.1.0 # https://github.com/benoitc/gunicorn
psycopg2==2.9.6 # https://github.com/psycopg/psycopg2
psycopg[c]==3.1.9 # https://github.com/psycopg/psycopg
{%- if cookiecutter.use_whitenoise == 'n' %}
Collectfast==2.2.0 # https://github.com/antonagestam/collectfast
{%- endif %}
Expand Down

0 comments on commit 4ef180e

Please sign in to comment.