25 lines
597 B
Python
25 lines
597 B
Python
from flask import Flask, render_template, request
|
|
import logging
|
|
|
|
logging.basicConfig(filename='app.log', encoding='utf-8', level=logging.DEBUG)
|
|
from models import db, ArtDavl
|
|
|
|
|
|
def create_app():
|
|
app = Flask(__name__)
|
|
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db'
|
|
app.secret_key ='6523e58bc0eec42c31b9635d5e0dfc23b6d119b73e633bf3a5284c79bb4a1ede'
|
|
db.init_app(app)
|
|
|
|
return app
|
|
|
|
newapp = create_app()
|
|
newapp_ctx =newapp.app_context()
|
|
newapp_ctx.push()
|
|
|
|
with newapp_ctx:
|
|
pass
|
|
|
|
if __name__ == '__main__':
|
|
newapp.run(host='0.0.0.0', port='3800', debug=True)
|