Pycloud/app/__init__.py

37 lines
1.1 KiB
Python
Raw Normal View History

2020-06-23 16:11:01 +02:00
from flask import Flask
from config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
2020-06-24 18:03:41 +02:00
from flask_wtf.csrf import CSRFProtect
2020-06-23 16:11:01 +02:00
app = Flask(__name__)
app.config.from_object(Config)
db = SQLAlchemy(app)
migrate = Migrate(app, db)
login = LoginManager(app)
2020-06-24 18:03:41 +02:00
csrf = CSRFProtect(app)
2020-06-23 16:11:01 +02:00
# There is the dictionnary, which can be usefull when you want to change the language.
words = {
'nameApp' : 'Pycloud',
'nameHome' : 'Home',
'nameUpload' : 'Upload',
'nameLogin' : 'Login',
2020-06-24 18:03:41 +02:00
'nameView' : 'View',
2020-06-23 16:11:01 +02:00
'nameRegister' : 'Register',
'termLogout' : 'Logout',
2020-06-23 19:23:57 +02:00
'termChoose' : 'Choose a directory',
2020-06-23 16:11:01 +02:00
'termSubmit' : 'Submit',
'termUsername' : 'Username',
'termPassword' : 'Password',
'termRepeatPassword' : 'Repeat Password',
'termRememberMe' : 'Remember Me',
'termIsAdmin' : 'Is Admin?',
'termRegistered' : 'Registered: ',
'ErrorInvalid' : 'Invalid Password or Username',
2020-06-24 18:03:41 +02:00
'ErrorUsername' : 'Username already used',
'ErrorNoFiles' : 'There is no files which belong to this user'
2020-06-23 16:11:01 +02:00
}
from app import routes, models