Add config.py.example for configuration
This commit is contained in:
@@ -13,9 +13,8 @@ def login_required(f):
|
||||
|
||||
def init_app(config):
|
||||
|
||||
if 'USERS_FOLDER' in config.keys() and 'PUBLIC_FOLDER' in config.keys():
|
||||
if 'USERS_FOLDER' in config.keys():
|
||||
users_folder = config['USERS_FOLDER']
|
||||
public_folder = config['PUBLIC_FOLDER']
|
||||
else:
|
||||
print ("L'application n'est pas configuré correctement, veuillez renseigner les paramètres USERS_FOLDER et/ou PUBLIC_FOLDER ne sont pas configuré")
|
||||
return False
|
||||
@@ -26,11 +25,6 @@ def init_app(config):
|
||||
os.makedirs(users_folder)
|
||||
print("Le dossier {} a été créé".format(users_folder))
|
||||
|
||||
if os.path.isdir(public_folder):
|
||||
print("Le dossier {} existe".format(public_folder))
|
||||
else:
|
||||
os.makedirs(public_folder)
|
||||
print("Le dossier {} a été créé".format(public_folder))
|
||||
|
||||
return True
|
||||
|
||||
|
||||
10
config.py.example
Normal file
10
config.py.example
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
HOST="127.0.0.1"
|
||||
PORT="7000"
|
||||
SECRET_KEY = "CHANGE-ME"
|
||||
STATIC_PATH = './app/static/'
|
||||
|
||||
#Dossier privé des utilisateurs
|
||||
# Spécifier le chemin complet exemple: /opt/monsiteperso/users
|
||||
USERS_FOLDER = "/PATH/USERS/FOLDERS"
|
||||
|
||||
Reference in New Issue
Block a user