Switch to gunicorn , need to add config file and proper password loading
This commit is contained in:
10
main.py
10
main.py
@ -3,6 +3,7 @@ from src.routes.routes import RouteManager
|
||||
from src.config.args import create_parser
|
||||
from src.config.config import Configuration
|
||||
from src.rendering.helpers import TemplateHelpers
|
||||
from src.server.file_manager import create_filemanager_blueprint
|
||||
|
||||
|
||||
def main():
|
||||
@ -15,6 +16,7 @@ def main():
|
||||
r = RouteManager(c)
|
||||
t = TemplateHelpers(c)
|
||||
|
||||
print("here")
|
||||
server = Server()
|
||||
|
||||
server.register_template_function("get_sibling_content_files", t.get_sibling_content_files)
|
||||
@ -27,7 +29,13 @@ def main():
|
||||
server.register_route("/", r.default_route, defaults={"path": ""})
|
||||
server.register_route("/<path:path>", r.default_route)
|
||||
|
||||
server.run()
|
||||
file_manager_bp = create_filemanager_blueprint(c.content_dir, url_prefix='/admin', auth_password="password")
|
||||
server.app.register_blueprint(file_manager_bp)
|
||||
|
||||
try:
|
||||
server.run()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Reference in New Issue
Block a user