TODO
Project description
What’s this project?
It’s a simple Django application which will automatically reload your browser everytime Django Development Server is restarted or any static file or template changes. Besides this, if you connect multiple browsers and devices on your development server, these will be all synchronized.
Quick start guide
Before installing, you’ll need to have a copy of Django already installed. For the current release, Django 3 or newer is required.
For further information, consult the Django download page, which offers convenient packaged downloads and installation instructions.
Installing
Automatic installation using PyPI
type:
pip install django3-livesync
Basic configuration and use
Once installed, you can add Django LiveSync to any Django-based project you’re working on. The default setup will enable the following features.
Every time django development server is reloaded, all connected browsers will automatically refresh.
Every time a static file or template is updated, all connected browsers will automatically refresh.
Your actions will be synchronized between all connected browsers and devices. Currently supports:
Page scroll.
Page reload.
Element click.
Form fields in general.
IMPORTANT: Currently, it was only tested against Google Chrome and Mozilla Firefox web browsers.
Configuration
Installing the application
Begin by adding livesync to the INSTALLED_APPS setting of your project. By default, the daemon will start watching all your installed apps template dirs. You can also specify the following additional settings:
- LIVE_PORT
This is the number of the port on which live server will run.
- INCLUDED_APPS
This tells django livesync to only watch for changes in apps in this set.
- EXCLUDED_APPS
This tells django livesync to ignore changes on apps in this set.
Setup Middleware
Add livesync.core.middleware.DjangoLiveSyncMiddleware to the MIDDLEWARE_CLASSES setting of your project.
IMPORTANT NOTES:
If you have ‘django.contrib.staticfiles’ application installed, you must register ‘django-livesync’ before it, otherwise live server will not launch.
Django LiveSync will only execute if DEBUG is set to True.
Example
You might have something like the following in your Django settings file:
DEBUG = True INSTALLED_APPS = ( '...', 'livesync', 'django.contrib.staticfiles', '...', ) DJANGO_LIVESYNC = { 'PORT': 9999 # this is optional and is default set to 9001. } MIDDLEWARE_CLASSES = ( 'livesync.core.middleware.DjangoLiveSyncMiddleware', )
Once you’ve done this, run python manage.py runserver as usual.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django3-livesync-1.tar.gz
.
File metadata
- Download URL: django3-livesync-1.tar.gz
- Upload date:
- Size: 24.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ca6cff0e88459c9588f99e125d8e337c32fc796ccc49e78bb734183291cb623 |
|
MD5 | 9787dd37feddfe1f05b4df84b54311b4 |
|
BLAKE2b-256 | a46e7b68ca977fdf3cc8606d064ad2848050ccd3865369deabb0a170b2b04f8c |
File details
Details for the file django3_livesync-1-py3-none-any.whl
.
File metadata
- Download URL: django3_livesync-1-py3-none-any.whl
- Upload date:
- Size: 28.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49d8d989d9f0ba9b9bb9af1b251550049a7e9d9d5315f1245ad0b6ebba596b20 |
|
MD5 | 1d8358c237586d08f4b7c89d69c44616 |
|
BLAKE2b-256 | 9dc5afdd13dddbff28a5015de208b1929201ad89a59c50ada9631b3ca2ccc856 |