22 lines
571 B
Python
22 lines
571 B
Python
import os
|
|
from datetime import timedelta
|
|
|
|
class Config:
|
|
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard_to_guess_string_for_flask_app'
|
|
SQLALCHEMY_DATABASE_URI = 'sqlite:///question_collector.db'
|
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
|
SQLALCHEMY_ENGINE_OPTIONS = {
|
|
'connect_args': {'check_same_thread': False}
|
|
}
|
|
|
|
# 设置 UTC+8 时区
|
|
import pytz
|
|
tz = pytz.timezone('Asia/Shanghai')
|
|
|
|
def naive_now():
|
|
from datetime import datetime
|
|
return datetime.now(tz)
|
|
|
|
def utc_now():
|
|
from datetime import datetime
|
|
return datetime.utcnow() |