#!/usr/local/bin/python3 # -*- coding: utf-8 -*- from flask import Flask, request, flash, render_template, url_for, session, redirect, abort, make_response, send_file, escape, send_from_directory from werkzeug.utils import secure_filename from wtforms import BooleanField, StringField, IntegerField, PasswordField, validators import sqlite3 from flask_bcrypt import Bcrypt from views.blog import postit from views.filesupload import filesupload from views.inscription import inscription from views.profil import profil from views.logs import logs from views.loginlogout import loginlogout from views.gallery import mygallery from tools.databaseinit import init_db, init_dir, db_migrate import glob, os, sys, time app = Flask( 'pywallter' ) app.config.from_pyfile('config.py') bcrypt = Bcrypt(app) init_db() db_migrate() if init_dir(): print ("Le repertoire des utilisateurs a été créer") #### Variables #################################################################################### DOSSIER_PERSO= app.config['DOSSIER_APP'] extensionimg = app.config['EXT_IMG'] ################################################################################################## app.register_blueprint(inscription) app.register_blueprint(postit) app.register_blueprint(filesupload) app.register_blueprint(profil) app.register_blueprint(logs) app.register_blueprint(loginlogout) app.register_blueprint(mygallery) def create_app(): app = Flask( 'pywallter' ) app.config.from_pyfile('config.py') bcrypt = Bcrypt(app) init_db() db_migrate() if init_dir(): print ("Le repertoire des utilisateurs a été créer") DOSSIER_PERSO= app.config['DOSSIER_APP'] extensionimg = app.config['EXT_IMG'] app.register_blueprint(inscription) app.register_blueprint(postit) app.register_blueprint(filesupload) app.register_blueprint(profil) app.register_blueprint(logs) app.register_blueprint(loginlogout) app.register_blueprint(mygallery) return app if __name__ == '__main__' : app.run(host='127.0.0.1', port=8000, debug=False)