django中间件,用于根据报头授权请求。
django-header-auth的Python项目详细描述
django header auth
=====
一个非常简单的django中间件,用于根据header授权请求。
installation
----
1。通过pip安装:
:::bash
$pip install django header auth
2。添加“headerAuthMiddleware”:
:::python
中间件类=(
…
“header auth.middleware.headerAuthMiddleware”,
“…
用法
----
添加包含要检查的头的“header auth”dict到设置文件:
●python
header-auth={
'http-x-u-some-header':'sometoken',
'http-x-u-anothertoken',
}
否则将返回一个403禁止的文件。
copyright
--
copyright(c)2013[localmed,inc.](http://www.localmed.com/)。有关详细信息,请参见许可证。
=====
一个非常简单的django中间件,用于根据header授权请求。
installation
----
1。通过pip安装:
:::bash
$pip install django header auth
2。添加“headerAuthMiddleware”:
:::python
中间件类=(
…
“header auth.middleware.headerAuthMiddleware”,
“…
用法
----
添加包含要检查的头的“header auth”dict到设置文件:
●python
header-auth={
'http-x-u-some-header':'sometoken',
'http-x-u-anothertoken',
}
否则将返回一个403禁止的文件。
copyright
--
copyright(c)2013[localmed,inc.](http://www.localmed.com/)。有关详细信息,请参见许可证。