La version 5 de Planète Casio. Regroupe le forum, les programmes, les tutoriel, les sprites et tous les autres outils développés par nos soins.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

__init__.py 914B

123456789101112131415161718192021222324252627282930
  1. from flask import Flask, g
  2. from flask_sqlalchemy import SQLAlchemy
  3. from flask_migrate import Migrate
  4. from flask_login import LoginManager
  5. from config import Config
  6. import time
  7. app = Flask(__name__)
  8. app.config.from_object(Config)
  9. db = SQLAlchemy(app)
  10. migrate = Migrate(app, db)
  11. @app.before_request
  12. def request_time():
  13. g.request_start_time = time.time()
  14. g.request_time = lambda: "%.5fs" % (time.time() - g.request_start_time)
  15. login = LoginManager(app)
  16. login.login_view = 'login'
  17. login.login_message = "Veuillez vous authentifier avant de continuer."
  18. from app import models # IDK why this is here, but it works
  19. from app.routes import index, search, users # To load routes at initialization
  20. from app.routes.account import login, account
  21. from app.routes.admin import index, groups, account, trophies
  22. from app.utils import pluralize # To use pluralize into the templates
  23. from app.utils import is_title