Skip to content

Commit 93cafab

Browse files
committed
Fix pyscopg3 package installation
1 parent 30b316f commit 93cafab

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

Pipfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ itsdangerous = "*"
1313
quart = "*"
1414
quart-wtforms = "*"
1515
aioquic = "*"
16-
psycopg-pool = "*"
17-
psycopg = {extras = ["binary"], version = "*"}
1816
quart-trio = "*"
1917
jsonpickle = "*"
2018
quart-bcrypt = "*"
@@ -25,6 +23,7 @@ google-genai = "*"
2523
quart-uploads = "*"
2624
flask-sqlalchemy = "*"
2725
quart-flask-patch = "*"
26+
psycopg = {extras = ["pool", "binary"], version = "*"}
2827

2928
[dev-packages]
3029
pytest-flask = "*"

Pipfile.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ def create_app() -> Quart:
4141
app = Quart(__name__, template_folder='view/templates', static_url_path='', static_folder='view/static')
4242
app.config.from_file("/etc/pythonrestapi_config.json", json.load)
4343
app.config["SEND_FILE_MAX_AGE_DEFAULT"] = timedelta(days=90)
44-
app.config["SQLALCHEMY_DATABASE_URI"] = f"postgresql+psycopg://{os.environ.get('DB_USERNAME')}:{parse.quote_plus(os.environ.get('DB_PASSWORD'))}@{app.config['DB_HOST']}/library"
45-
app.config["POSTGRESQL_DATABASE_URI"] = f"postgresql://{os.environ.get('DB_USERNAME')}:{parse.quote_plus(os.environ.get('DB_PASSWORD'))}@{app.config['DB_HOST']}/library"
44+
app.config["SQLALCHEMY_DATABASE_URI"] = appconfig.SQLALCHEMY_DATABASE_URI
45+
app.config["POSTGRESQL_DATABASE_URI"] = appconfig.POSTGRESQL_DATABASE_URI
4646
app.config["TEMPLATES_AUTO_RELOAD"] = True
4747
app.config["WTF_CSRF_TIME_LIMIT"] = None # Max age in seconds for CSRF tokens. If set to None, the CSRF token is valid for the life of the session.
4848
app.after_request(_add_secure_headers)

0 commit comments

Comments
 (0)