import os

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager

project_root = os.path.dirname(os.path.realpath(__file__))
# template_path = os.path.join(project_root, 'templates')
template_path = os.path.join(project_root, 'templates')
# static_path = os.path.join(project_root, 'app/static')



app = Flask(__name__, static_url_path='/webgds/static', static_folder='static', template_folder=template_path)
app.secret_key = 'alskje13409@$#WERSAF#%^%^R^%AWDSAd43*&&%^#@'
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://jiznksyv_website:GDs2019!@localhost/jiznksyv_website?charset=utf8mb4'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
app.config['PAGE_SIZE'] = 9
app.config['UPLOAD_FOLDER'] = 'static/images'
app.config['STATIC_FOLDER'] = 'static'
app.config['Path'] = template_path

db = SQLAlchemy(app=app)
login = LoginManager(app=app)
migrate = Migrate(app, db)
