-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
executable file
·25 lines (23 loc) · 882 Bytes
/
Copy pathconfig.py
File metadata and controls
executable file
·25 lines (23 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from flask import Flask
import mongoengine
class Config:
SECRET_KEY = 'mysecretsecretkey'
def init_app(self, app):
app.config['SECRET_KEY'] = self.SECRET_KEY
app.config['MAIL_SERVER'] = 'smtp.qq.com'
app.config['MAIL_PORT'] = 465
app.config['MAIL_USE_TLS'] = False
app.config['MAIL_USE_SSL'] = True
app.config['MAIL_USERNAME'] = '123@qq.com'
app.config['MAIL_PASSWORD'] = '123'
app.config['ADMINS'] = ['123@qq.com']
mongoengine.connect('mydatabase')
import os
from app.general import COVER_FOLDER, AVATAR_FOLDER, FACE_FOLDER
if not os.path.exists(COVER_FOLDER):
os.mkdir(COVER_FOLDER)
if not os.path.exists(AVATAR_FOLDER):
os.mkdir(AVATAR_FOLDER)
if not os.path.exists(FACE_FOLDER):
os.mkdir(FACE_FOLDER)
return app