Skip to main content

cas for apistellar

Project description

CAS for apistellar

USEAGE

pip install apistellar-cas
from apistellar_cas import nit

# before app init
init()
...
from apistar import App
from apistellar import Controller, route, get
from apistellar_cas import login_required


@route("/", name="welcome")
class WelcomeController(Controller):

    @get("/")
    @login_required() # add this
    def index(self, app: App) -> str:
        return app.render_template('index.html')
# settings.py
CAS_SERVER = 'https://xxx.xxx.xxx'
CAS_LOGIN_ROUTE = '/xxxx'
CAS_AFTER_LOGIN = 'view:welcome:index'
CAS_USERNAME_SESSION_KEY = "username"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apistellar-cas-0.0.2.tar.gz (4.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page