remplacement des menu et ajout d'un fichiers de configuration
This commit is contained in:
14
pywallter.py
14
pywallter.py
@@ -20,6 +20,7 @@ from tools.databaseinit import init_db, init_dir
|
||||
import glob, os, sys, time
|
||||
|
||||
app = Flask( 'pywallter' )
|
||||
app.config.from_pyfile('config.py')
|
||||
bcrypt = Bcrypt(app)
|
||||
|
||||
if init_db():
|
||||
@@ -33,15 +34,15 @@ if init_dir():
|
||||
|
||||
|
||||
# Set the secret key. Keep this really secret
|
||||
app.secret_key = 'klfkdlfkdslfkln234325;cx!' # Chiffre les cookies si j'ai bien capté.
|
||||
#app.secret_key = 'klfkdlfkdslfkln234325;cx!' # Chiffre les cookies si j'ai bien capté.
|
||||
# À générer aléatoirement impérativement avant de mettre en ligne.
|
||||
|
||||
#### Variables ####################################################################################
|
||||
|
||||
|
||||
DOSSIER_PERSO='users/'
|
||||
DOSSIER_PERSO= app.config['DOSSIER_APP']
|
||||
|
||||
extensionimg = {'.jpg', '.JPG', '.png', '.PNG', '.gif', '.GIF', '.bmp', '.BMP', '.jpeg', '.JPEG' }
|
||||
extensionimg = app.config['EXT_IMG']
|
||||
|
||||
##################################################################################################
|
||||
|
||||
@@ -58,14 +59,17 @@ def gallery():
|
||||
UTILISATEUR='%s' % escape(session['username'])
|
||||
THUMBNAILS=DOSSIER_PERSO + UTILISATEUR + '/images/thumbnails/'
|
||||
fichiers = [fich for fich in os.listdir(THUMBNAILS)]
|
||||
return render_template('gallery.html', THUMBNAILS=THUMBNAILS, fichiers=fichiers)
|
||||
return render_template('gallery.html',
|
||||
section='Gallery',
|
||||
THUMBNAILS=THUMBNAILS,
|
||||
fichiers=fichiers)
|
||||
else :
|
||||
return redirect(url_for('loginlogout.login'))
|
||||
|
||||
@app.route( '/parametres/', methods=['GET','POST'] )
|
||||
def parametres() :
|
||||
if 'username' in session :
|
||||
return render_template('parametres.html')
|
||||
return render_template('parametres.html', section='profil')
|
||||
else:
|
||||
return redirect(url_for('loginlogout.login'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user