mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-03 13:14:28 +03:00
Merge pull request #4421 from Andrew-Chen-Wang/patch-7
Change psycopg2 to psycopg3
This commit is contained in:
commit
4ef180edb1
|
@ -20,14 +20,14 @@ 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}",
|
||||
|
@ -35,7 +35,7 @@ while True:
|
|||
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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Reference in New Issue
Block a user