加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

django-decorator-include

Include Django URL patterns with decorators.

Installation

Installation from Source

Unpack the archive, cd to the source directory, and run the following command:

python setup.py install

Installation with pip and git

Assuming you have pip and git installed, run the following command to install from the GitHub repository:

pip install git+git://github.com/jeffkistler/django-decorator-include.git#egg=django-decorator-include

Usage

decorator_include is intended for use in URL confs as a replacement for the django.conf.urls.defaults.include function. It works in almost the same way as include, however the first argument should be either a decorator or an iterable of decorators to apply, in reverse order, to all included views. Here is an example URL conf:

from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required

from decorator_include import decorator_include

urlpatterns = patterns('',
    url(r'^$', 'mysite.views.index', name='index'),
    url(r'^secret/', decorator_include(login_required, 'mysite.secret.urls'),
)

空文件

简介

取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化