![]() $ python manage.py livereload path/to/my-extra-directory/ By default livereload server watches the files that are found by your staticfiles finders and your template loaders. manage.py livereload -ignore-file-extensions=.less.scssĮxtra files and/or paths to watch for changes can be added as positional arguments. manage.py livereload -ignore-static-dirs manage.py livereload -ignore-template-dirs You can ignore template directories using: :: Now every time you hit save in your editor, the django-development-server/livereload-server automatically updates the staticfiles Customizationīy default both template and staticfiles directories are watched. ![]() In the browser's address bar access your web app by doing: Start the django development server as usual (in another console):: Specify them by setting LIVERELOAD_HOST and LIVERELOAD_PORT in settings.py. If you need the livereload server to use a different host and port than the default 127.0.0.9, Through a templatetag in your base.html (or similar) template::Įither of these options will inject the livereload.js script into your webpages if DEBUG setting is on. Through middleware by adding '' to MIDDLEWARE_CLASSES (probably at the end):: ![]() Next you need to inject the loading of the livereload javascript. InstallationĪdd 'livereload' to the INSTALLED_APPS, before '' if this is used:: INSTALLED_APPS = ( This django app adds a management command that starts a livereload server watching all your static files and templates as wellĪs a custom runserver command that issues livereload requests when the development server is ready after a restart.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |