当模板、CSS或JavaScript文件被修改时,自动重新加载浏览器。
django-debug-toolbar-autoreload的Python项目详细描述
django调试工具栏自动下载
THIS MODULE IS NO LONGER MAINTAINED
I decided to stop the development on this project since there are now more mature solutions to the same problem. I personally prefer to use gulp to observe files for changes and to start a livereload server that can be used with your browser’s livereload plugin.
Here is an example ^{tt1}$ that does nearly the same as the autoreload feature of this package:
var gulp = require('gulp'), livereload = require('gulp-livereload'), watch = require('gulp-watch'); var watchPaths = [ 'templates/**.html', 'static/**.js', 'static/**.css', ]; gulp.task('watch', function() { gulp.src(watchPaths) .pipe(watch()) .pipe(livereload()); });If you still have interest in this project and want to maintain it, just drop me a message and we can discuss the details.
这个包包含一个额外的面板,用于优秀的django-debug-toolbar。
其目的是在以下情况下自动重新加载页面: 呈现当前页已更改。对于您的浏览器 runserver的自动重新加载功能适用于您的python代码。
观看此屏幕广播,了解简短的介绍:http://www.youtube.com/watch?v=zQSoJF70if4
安装
- 将debug_toolbar_autoreload源文件夹放入PYTHONPATH。
- 将'debug_toolbar_autoreload'添加到INSTALLED_APPS设置中。
- 将'debug_toolbar_autoreload.AutoreloadPanel'添加到DEBUG_TOOLBAR_PANELS中。
这意味着您的设置文件应该类似于:
INSTALLED_APPS = ( # ... other apps ... 'debug_toolbar', 'debug_toolbar_autoreload', ) DEBUG_TOOLBAR_PANELS = ( # default panels 'debug_toolbar.panels.version.VersionDebugPanel', 'debug_toolbar.panels.timer.TimerDebugPanel', 'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel', 'debug_toolbar.panels.headers.HeaderDebugPanel', 'debug_toolbar.panels.profiling.ProfilingDebugPanel', 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel', 'debug_toolbar.panels.sql.SQLDebugPanel', 'debug_toolbar.panels.template.TemplateDebugPanel', 'debug_toolbar.panels.cache.CacheDebugPanel', 'debug_toolbar.panels.signals.SignalDebugPanel', 'debug_toolbar.panels.logger.LoggingPanel', # autoreload panel 'debug_toolbar_autoreload.AutoreloadPanel', )
需求:django 1.4或更高版本是必需的,因为我们需要 多线程开发服务器。
贡献
下载并设置项目:
git clone https://github.com/gregmuellegger/django-debug-toolbar-autoreload.git cd django-debug-toolbar-autoreload virtualenv . source bin/activate pip install -r requirements/development.txt python manage.py syncdb python manage.py runserver
在浏览器中打开http://localhost:8000/中的一个演示页。
黑客
发送拉取请求
更改日志
0.2.0
- 如果只更改了css文件,则不要重新加载整个页面。改为加载css 到位。
- 正在将changes.rst添加到manifest.in,其中在安装期间导致错误。
0.1.1
- 尝试检测开发服务器是否要关闭。在这次改变之前 服务器是否仍在后台运行并且不允许您 重新启动。
0.1.0
- 初次发布。