Try ERPNext Buy Support Partners Foundation

Installed demo data - how login as admin on demo mode

I’ve created demo data on my box but want to login as an admin on the demo installation of my own.

I can view the demo and its data but, I’d like to “turn off” demo mode and login as an admin on my own demo installation.

Any tips?

Hello good question

I don’t have the answer, but did find this that should help -

A query of the two install environments gave this for the demo home page case:

In [3]: frappe.db.get_default(“desktop:home_page”)
Out[3]: ‘workspace’

and this for the basic login home page:

In [2]: frappe.db.get_default(“desktop:home_page”)
Out[2]: ‘desktop’

Then a grep of the code gave this (edited) for the two cases -

For the demo workspace:

erpdev@2052004lts40G:~/frappe-bench$ find apps/ -name *.py | xargs grep workspace
apps/frappe/frappe/boot.py:	bootinfo.allowed_workspaces = get_desk_sidebar_items(True)
apps/frappe/frappe/boot.py:		page = frappe.desk.desk_page.get('workspace')
apps/frappe/frappe/desk/desktop.py:	def build_workspace(self):
apps/frappe/frappe/desk/desktop.py:	wspace.build_workspace()
apps/frappe/frappe/desk/desktop.py:def get_custom_workspace_for_user(page):
apps/frappe/frappe/desk/desktop.py:	page_doc = get_custom_workspace_for_user(page)
apps/frappe/frappe/desk/page/setup_wizard/setup_wizard.py:	frappe.db.set_default('desktop:home_page', 'workspace')

And for the standard desktop:

frappe@ubuntu:~/frappe-bench$ find apps/ -name *.py | xargs grep desktop

apps/frappe/frappe/boot.py:	home_page = frappe.db.get_default("desktop:home_page")
apps/frappe/frappe/config/__init__.py:		modules = frappe.get_attr(app + '.config.desktop.get_data')() or {}

apps/frappe/frappe/sessions.py:		device = frappe.session.data.device or "desktop"
apps/frappe/frappe/sessions.py:	for device in ("desktop", "mobile"):
apps/frappe/frappe/sessions.py:		self.device = frappe.form_dict.get("device") or "desktop"
apps/frappe/frappe/sessions.py:		self.device = self.device and self.device[0][0] or 'desktop'
apps/frappe/frappe/sessions.py:def get_expiry_period(device="desktop"):

apps/erpnext/erpnext/setup/setup_wizard/test_setup_wizard.py:	# Wait for desktop
apps/erpnext/erpnext/setup/setup_wizard/test_setup_wizard.py:	driver.wait_for('#page-desktop', timeout=600)
apps/erpnext/erpnext/setup/install.py:	if frappe.db.get_default('desktop:home_page') == 'desktop':

The lists above are edited, other files and patches will give more clues and ideas to pursue.

In your case a custom script patch to restore the standard desktop login from the demo workspace page would need to be developed.

Good luck with your exploration and learning!

1 Like