Stop using the deprecated FLASK_ENV environment variable

This commit is contained in:
Éloi Rivard 2022-11-01 12:56:07 +01:00
parent cdac8cfbff
commit 4163d2eb13
4 changed files with 13 additions and 7 deletions

View file

@ -19,6 +19,12 @@ Added
- Python 3.11 support. :pr:`61`
Changed
*******
- Replaced the use of the deprecated `FLASK_ENV` environment variable by
`FLASK_DEBUG`.
[0.0.12] - 2022-10-24
=====================

View file

@ -42,7 +42,7 @@ def setup_config(app, config=None, validate=True):
"Either create conf/config.toml or set the 'CONFIG' variable environment."
)
if os.environ.get("FLASK_ENV") == "development":
if app.debug:
canaille.installation.setup_keypair(app.config)
if validate:

View file

@ -1,4 +1,4 @@
slapd: ./slapd.sh
canaille: env AUTHLIB_INSECURE_TRANSPORT=1 FLASK_ENV=development CONFIG=conf/canaille.toml FLASK_APP=../../canaille flask run --extra-files conf/canaille.toml
client1: env FLASK_ENV=development CONFIG=../conf/client1.cfg FLASK_APP=client flask run --port=5001
client2: env FLASK_ENV=development CONFIG=../conf/client2.cfg FLASK_APP=client flask run --port=5002
canaille: env FLASK_DEBUG=1 AUTHLIB_INSECURE_TRANSPORT=1 CONFIG=conf/canaille.toml FLASK_APP=../../canaille flask run --extra-files conf/canaille.toml
client1: env FLASK_DEBUG=1 CONFIG=../conf/client1.cfg FLASK_APP=client flask run --port=5001
client2: env FLASK_DEBUG=1 CONFIG=../conf/client2.cfg FLASK_APP=client flask run --port=5002

View file

@ -26,7 +26,7 @@ services:
dockerfile: demo/Dockerfile-canaille
environment:
- AUTHLIB_INSECURE_TRANSPORT=1
- FLASK_ENV=development
- FLASK_DEBUG=1
- CONFIG=/opt/canaille/conf/canaille.toml
- FLASK_APP=canaille
volumes:
@ -42,7 +42,7 @@ services:
context: .
dockerfile: Dockerfile-client
environment:
- FLASK_ENV=development
- FLASK_DEBUG=1
- CONFIG=/opt/client/conf/client1.cfg
- FLASK_APP=client
volumes:
@ -60,7 +60,7 @@ services:
context: .
dockerfile: Dockerfile-client
environment:
- FLASK_ENV=development
- FLASK_DEBUG=1
- CONFIG=/opt/client/conf/client2.cfg
- FLASK_APP=client
volumes: