[Django]-How to auto refresh admin page on browser after data have changed on server?

3👍

You can send ajax request (do it in your custom js file) to same url == window.location.href (for example every 10 seconds)

class OrderAdmin(admin.ModelAdmin):
    class Meta:
        model = Order
    class Media:
        js = ("my_code.js",)

Useful links:

https://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-asset-definitions

http://www.w3schools.com/jquery/ajax_ajax.asp

http://api.jquery.com/jquery.ajax/

Leave a comment