arxiv.base package

arXiv base Flask components.

Provides Base, which attaches base templates, static assets, global context processors, and exception handlers to a flask.Flask app instance.

Intended for use in an application factory. For example:

python
from flask import Flask
from arxiv.base import Base
from someapp import routes


def create_web_app() -> Flask:
   app = Flask('someapp')
   app.config.from_pyfile('config.py')

   Base(app)   # Registers the base/UI blueprint.
   app.register_blueprint(routes.blueprint)    # Your blueprint.
return app
class arxiv.base.Base(app=None)[source]

Bases: object

Attaches a base UI blueprint and context processors to an app.

init_app(app)[source]

Create and register the base UI blueprint.

Return type

None