Is there any way to know a specific page is being visited in Django? -
i have page in django allows 1 user see @ same time. there way information? if can know visiting page, can block other requests then.
thank you.
use database "referee". make class inherits generic.templateview
, override get
and/or post
method, , before calling parent, make query database: if page being watched dont call parent , return redirect main page.
but may run trouble if 1 viewing page switches off computer: how know he's not watching anymore? may have implement watchdog or something, , then, chrome, watchdog stopped if it's not active tab... if search way of dealing problem.
Comments
Post a Comment