Ethan Dalool
038ce9cffb
I want to reduce some complexity around here, part of which is that launch imported entrypoint imported backend, all to do some proxy wrapping which isn't necessary for the dev case anyway. Less layers of wrapping and importing is good. Plus I think this naming is more clear. Additionally, I realized that the entrypoint aka prod launcher was never updated to init the ycdldb as that was only done by the argparse launcher. Now it's hardcoded and I'll consider adding a config file.
21 lines
578 B
Python
21 lines
578 B
Python
'''
|
|
This file is the WSGI entrypoint for remote / production use.
|
|
|
|
If you are using Gunicorn, for example:
|
|
gunicorn ycdl_flask_prod:site --bind "0.0.0.0:PORT" --access-logfile "-"
|
|
'''
|
|
import werkzeug.middleware.proxy_fix
|
|
|
|
import bot
|
|
import ycdl
|
|
|
|
import backend
|
|
|
|
backend.site.wsgi_app = werkzeug.middleware.proxy_fix.ProxyFix(backend.site.wsgi_app)
|
|
|
|
site = backend.site
|
|
|
|
# NOTE: Consider adding a local .json config file.
|
|
youtube_core = ycdl.ytapi.Youtube(bot.get_youtube_key())
|
|
backend.common.init_ycdldb(youtube_core, create=False)
|
|
backend.common.start_refresher_thread(86400)
|