Initialise Babel on application startup
This commit is contained in:
parent
61fe581df6
commit
e5e93c60b3
@ -17,6 +17,7 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from flask import Flask, render_template
|
from flask import Flask, render_template
|
||||||
|
from flask_babel import Babel
|
||||||
|
|
||||||
|
|
||||||
class CalendarSocialApp(Flask):
|
class CalendarSocialApp(Flask):
|
||||||
@ -28,6 +29,7 @@ class CalendarSocialApp(Flask):
|
|||||||
config_name = os.environ.get('ENV', config or 'dev')
|
config_name = os.environ.get('ENV', config or 'dev')
|
||||||
self.config.from_pyfile(f'config_{config_name}.py', True)
|
self.config.from_pyfile(f'config_{config_name}.py', True)
|
||||||
db.init_app(self)
|
db.init_app(self)
|
||||||
|
babel = Babel(app=self)
|
||||||
|
|
||||||
|
|
||||||
app = CalendarSocialApp(__name__)
|
app = CalendarSocialApp(__name__)
|
||||||
|
Loading…
Reference in New Issue
Block a user