wsgi
This commit is contained in:
parent
360b4d7b21
commit
bfb76658d1
4 changed files with 5 additions and 8 deletions
|
@ -26,8 +26,8 @@ mail = Mail()
|
||||||
mail.init_app(app)
|
mail.init_app(app)
|
||||||
bootstrap = Bootstrap()
|
bootstrap = Bootstrap()
|
||||||
bootstrap.init_app(app)
|
bootstrap.init_app(app)
|
||||||
csrf = CSRFProtect()
|
csrf = CSRFProtect(app)
|
||||||
csrf.init_app(app)
|
#csrf.init_app(app)
|
||||||
babel = Babel()
|
babel = Babel()
|
||||||
babel.init_app(app)
|
babel.init_app(app)
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ app.json_encoder = CustomJSONEncoder
|
||||||
if not app.debug:
|
if not app.debug:
|
||||||
import logging
|
import logging
|
||||||
from logging.handlers import RotatingFileHandler
|
from logging.handlers import RotatingFileHandler
|
||||||
file_handler = RotatingFileHandler('log/proxadmin.log', 'a', 1 * 1024 * 1024, 10)
|
file_handler = RotatingFileHandler('/home/proxadmin/appserver/proxadmin/app/log/proxadmin.log', 'a', 1 * 1024 * 1024, 10)
|
||||||
file_handler.setLevel(logging.INFO)
|
file_handler.setLevel(logging.INFO)
|
||||||
file_handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]'))
|
file_handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]'))
|
||||||
app.logger.addHandler(file_handler)
|
app.logger.addHandler(file_handler)
|
||||||
|
|
|
@ -15,6 +15,7 @@ def make_shell_context():
|
||||||
Deployment=Deployment)
|
Deployment=Deployment)
|
||||||
|
|
||||||
migrate = Migrate(app, db)
|
migrate = Migrate(app, db)
|
||||||
|
|
||||||
manager = Manager(app)
|
manager = Manager(app)
|
||||||
manager.add_command('shell', Shell(make_context=make_shell_context))
|
manager.add_command('shell', Shell(make_context=make_shell_context))
|
||||||
manager.add_command('db', MigrateCommand)
|
manager.add_command('db', MigrateCommand)
|
||||||
|
|
4
run.py
4
run.py
|
@ -1,4 +0,0 @@
|
||||||
from app import app
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
app.run()
|
|
|
@ -15,6 +15,6 @@ activate_this = '/home/proxadmin/appserver/bin/activate_this.py'
|
||||||
with open(activate_this) as file_:
|
with open(activate_this) as file_:
|
||||||
exec(file_.read(), dict(__file__=activate_this))
|
exec(file_.read(), dict(__file__=activate_this))
|
||||||
|
|
||||||
sys.path.append('/home/proxadmin/appserver/proxmaster-panel')
|
sys.path.append('/home/proxadmin/appserver/proxadmin')
|
||||||
from app import app as application
|
from app import app as application
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue