一个可重用的django应用程序,用于向django cms添加自定义重定向操作。
cmsplugin-redirect的Python项目详细描述
一个可重用的django应用程序,用于向django cms添加自定义重定向操作。
安装
如果要安装pypi的最新稳定版本:
$ pip install cmsplugin-redirect
如果您有冒险精神并希望安装来自github的最新提交:
$ pip install -e git://github.com/bitmazk/cmsplugin-redirect.git#egg=cmsplugin_redirect
将cmsplugin_redirect添加到INSTALLED_APPS:
INSTALLED_APPS = ( ..., 'cmsplugin_redirect', )
将ForceResponseMiddleware添加到中间件类设置:
MIDDLEWARE_CLASSES = ( ... 'cmsplugin_redirect.middleware.ForceResponseMiddleware', )
运行./manage.py migrate以应用南部迁移。
用法
您可以将Redirect action插件添加到占位符中,就像添加 CMS页面管理中的所有其他插件。
您可以通过下拉列表选择要重定向到哪个CMS页面。 如果将page_link选项留空,插件将重定向到第一个 页面的子级。
小心,不要意外地创建无限的重定向循环。
贡献
如果您想参与此项目,请执行以下步骤:
# Fork this repository # Clone your fork $ mkvirtualenv -p python2.7 cmsplugin-redirect $ pip install -r test_requirements.txt $ ./logger/tests/runtests.sh # You should get no failing tests $ git co -b feature_branch master # Implement your feature and tests # Describe your change in the CHANGELOG.txt $ git add . && git commit $ git push origin feature_branch # Send us a pull request for your feature branch
无论何时运行测试,都会在 tests/coverage/index.html。添加新功能时,请确保 你把保险范围保持在100%。
路线图
查看github上的问题跟踪程序,以了解未来的里程碑和功能。