当模板、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

安装

  1. debug_toolbar_autoreload源文件夹放入PYTHONPATH
  2. 'debug_toolbar_autoreload'添加到INSTALLED_APPS设置中。
  3. '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或更高版本是必需的,因为我们需要 多线程开发服务器。

贡献

  1. 下载并设置项目:

    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
    
  2. 在浏览器中打开http://localhost:8000/中的一个演示页。

  3. 黑客

  4. 发送拉取请求

更改日志

0.2.0

  • 如果只更改了css文件,则不要重新加载整个页面。改为加载css 到位。
  • 正在将changes.rst添加到manifest.in,其中在安装期间导致错误。

0.1.1

  • 尝试检测开发服务器是否要关闭。在这次改变之前 服务器是否仍在后台运行并且不允许您 重新启动。

0.1.0

  • 初次发布。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
JPanel的java滚动窗格?   java JPA查询方法:findTopX,其中X是给定的(变量)数?   当应用程序在Oreo中处于后台时,java音乐服务在几秒钟后不工作   java通过TCP流发送密钥编码的字符串BadPaddingException with Windows   java在这里构建代码的更好方法是什么?   如何使用Java(无给定参数)检查列表中是否有数字   跨多个JVM的java事务控制   dataframe如何使用SparkJavaAPI的MapFunction和ReduceFunction在集群上并行处理这个问题?   java如何在多模块spring引导中配置yml文件   已安装java JDBC驱动程序,但出现异常   JUnit 4中的java,有没有一种方法可以在扩展BlockJUnit4ClassRunner的自定义运行程序中,在all@BeforeClass之前运行一段代码   继续未能选择JAVA上的radioButton   java如何通过PHP代码运行shell命令?   java JSlider SynthLookandFeel填充颜色   java给定一个数字,打印下三个数字   java SpringMVC(安全)403错误   java Graphhopper从装载的obb文件系统加载路由信息时出错   java安全工具扫描问题,发现依赖默认编码:新字符串(字节[])   java如何获取嵌套字段