mirror of
https://github.com/Llloooggg/Dyxless.git
synced 2026-03-06 02:36:24 +03:00
Переход на postgresql
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import os
|
||||
import json
|
||||
|
||||
from flask import Flask
|
||||
from flask_mail import Mail
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from flask_migrate import Migrate
|
||||
from flask_login import LoginManager
|
||||
|
||||
app = Flask(
|
||||
@@ -12,6 +12,7 @@ app = Flask(
|
||||
static_folder="dyxless/static",
|
||||
)
|
||||
db = SQLAlchemy()
|
||||
migrate = Migrate(app, db)
|
||||
mail = Mail()
|
||||
|
||||
with open("dyxless/config.json") as config_file:
|
||||
@@ -59,6 +60,3 @@ app.register_blueprint(main_blueprint)
|
||||
from .mails import mails as mails_blueprint
|
||||
|
||||
app.register_blueprint(mails_blueprint)
|
||||
|
||||
if not os.path.exists(app.config["SQLALCHEMY_DATABASE_URI"]):
|
||||
db.create_all(app=app)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"APP_EMAIL": "appsender@gmail.com
|
||||
},
|
||||
"db_settings": {
|
||||
"SQLALCHEMY_DATABASE_URI": "sqlite:///db.sqlite"
|
||||
"SQLALCHEMY_DATABASE_URI": "postgresql://ownername:pass@localhost/dyxless"
|
||||
},
|
||||
"mail_settings": {
|
||||
"MAIL_SERVER": "smtp.gmail.com",
|
||||
|
||||
Reference in New Issue
Block a user