mirror of
https://github.com/MathiasDPX/grainParisArt.git
synced 2025-02-23 06:12:06 +00:00
Always load the .env file
If the app is run in another way than `python app.py`, the environment file will not be loaded.
This commit is contained in:
parent
ca9e820552
commit
2111a2050c
1 changed files with 6 additions and 4 deletions
10
app.py
10
app.py
|
@ -4,10 +4,12 @@ import os
|
||||||
from flask import Flask, render_template, request
|
from flask import Flask, render_template, request
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
# IMPORT DES MODULES
|
# IMPORT DES MODULES
|
||||||
from modules.Classes import *
|
from modules.Classes import *
|
||||||
|
|
||||||
# On charge les variables d'environnement par défaut pour avoir la liste des cinémas
|
# On charge les variables d'environnement...
|
||||||
|
dotenv.load_dotenv(".env")
|
||||||
|
# et celles par défaut pour avoir la liste des cinémas
|
||||||
dotenv.load_dotenv(".env.sample")
|
dotenv.load_dotenv(".env.sample")
|
||||||
|
|
||||||
WEBSITE_TITLE = os.environ.get("WEBSITE_TITLE", "GrainParisArt")
|
WEBSITE_TITLE = os.environ.get("WEBSITE_TITLE", "GrainParisArt")
|
||||||
|
@ -59,7 +61,7 @@ def getShowtimes(date):
|
||||||
"seances": {}
|
"seances": {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if theater.name not in data[movie.title]["seances"].keys():
|
if theater.name not in data[movie.title]["seances"].keys():
|
||||||
data[movie.title]["seances"][theater.name] = []
|
data[movie.title]["seances"][theater.name] = []
|
||||||
|
|
||||||
|
@ -140,4 +142,4 @@ def home():
|
||||||
)
|
)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run()
|
app.run()
|
Loading…
Add table
Reference in a new issue