from flask import Flask from config import Config from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_login import LoginManager from flask_wtf.csrf import CSRFProtect app = Flask(__name__) app.config.from_object(Config) db = SQLAlchemy(app) migrate = Migrate(app, db) login = LoginManager(app) csrf = CSRFProtect(app) # There is the dictionnary, which can be usefull when you want to change the language. words = { 'nameApp' : 'Pycloud', 'nameHome' : 'Home', 'nameUpload' : 'Upload', 'termUsers' : 'Users', 'nameLogin' : 'Login', 'nameView' : 'View', 'nameRegister' : 'Register', 'termLogout' : 'Logout', 'termFilename' : 'Filename (leave blank to keep the original name)', 'termUploadFile' : 'Upload File', 'termSFolder' : "'s folder", 'termChoose' : 'Choose a directory', 'termSubmit' : 'Submit', 'termFiles' : 'Files', 'termUsername' : 'Username', 'termPassword' : 'Password', 'termRepeatPassword' : 'Repeat Password', 'termRememberMe' : 'Remember Me', 'termIsAdmin' : 'Is Admin?', 'termRegistered' : 'Registered: ', 'ErrorInvalid' : 'Invalid Password or Username', 'ErrorUsername' : 'Username already used', 'ErrorNoFiles' : 'There is no files which belong to this user', 'ErrorId' : 'This ID reffer to nothing', 'ErrorPermission' : "You don't have the permission to acces to this page", 'ErrorLogged' : 'You have to be logged in to acces to this page' } from app import routes, models