0

i have create one Django app in which i want to pass data to html template which is comming from my database (table's last entered user name ) and show it html page but user name can automatically change to new one without refreshing page

TSOP 1732
  • 47
  • 1
  • 1
  • 3

1 Answers1

0

I would query the latest username using something like this:

username = Username.objects.order_by('-created_at').first()

Then you can dynamically update the page by reloading it using jQuery. More info on that here

joshlsullivan
  • 1,375
  • 2
  • 14
  • 21
  • Take a look at these jQuery examples - [https://api.jquery.com/category/manipulation/dom-insertion-inside/](https://api.jquery.com/category/manipulation/dom-insertion-inside/) – joshlsullivan Sep 17 '19 at 17:08