run

How to run the repo, with different options.

rhaptos2.repo.run

run.py - Launch the repo app.

This is the suggested method for running a WSGI Server - we instantiate the repo app, and pass it to the waitress server (To be replaced by gunicorn):

python run.py --config=../../testing.ini
def make_app(name, confd):
/ an attempt at an app_factory / open(“/tmp/log”, “a”).write(“APPFACTORYCALLED
”)

app = Flask(name) app.config.update(confd) app.add_url_rule(“/”, view_func=index) app.add_url_rule(“/favicon”, view_func=favicon) app.add_url_rule(“/cms/<path:path>”, view_func=cms)

return app

class rhaptos2.repo.run.AddTestUser(app)[source]

We are faking a user header to avoid onerous logins via openid for test situations

rhaptos2.repo.run.get_app(opts, args, config, as_standalone=False, with_testuser=False)[source]

creates and sets up the app, but does not run it through flask server unless told to This intends to return a valid WSGI app to later be called by say gunicorn

todo: I would like to use @pumazi approach of only importing _standalone server as needed

returns a Flask app.wsgi_app, which can be passed into wsgi chain

rhaptos2.repo.run.initialize_database()[source]

Initialize the database tables.

rhaptos2.repo.run.wsgi_run(app, opts, args)[source]

Project Versions

Table Of Contents

Previous topic

Common functionality

Next topic

Glossary

This Page