apistellar-cas-0.0.2
توضیحات
cas for apistellar
| ویژگی | مقدار |
|---|---|
| سیستم عامل | Unix |
| نام فایل | apistellar-cas-0.0.2 |
| نام | apistellar-cas |
| نسخه کتابخانه | 0.0.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | cn |
| ایمیل نویسنده | cnaafhvk@foxmail.com |
| آدرس صفحه اصلی | https://www.github.com/ShichaoMa/apistellar-cas |
| آدرس اینترنتی | https://pypi.org/project/apistellar-cas/ |
| مجوز | MIT |
# CAS for apistellar
## USEAGE
```angular2
pip install apistellar-cas
```
```python
from apistellar_cas import nit
# before app init
init()
...
```
```python
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')
```
```python
# settings.py
CAS_SERVER = 'https://xxx.xxx.xxx'
CAS_LOGIN_ROUTE = '/xxxx'
CAS_AFTER_LOGIN = 'view:welcome:index'
CAS_USERNAME_SESSION_KEY = "username"
```
نحوه نصب
نصب پکیج whl apistellar-cas-0.0.2:
pip install apistellar-cas-0.0.2.whl
نصب پکیج tar.gz apistellar-cas-0.0.2:
pip install apistellar-cas-0.0.2.tar.gz