Hi,
We need to create new custom app to implement custom authentication and append to the current methods, so that we can integrate ERP NEXT Pages on our inhouse web portal to open seamlessly (with out prompting for ERPNext login) on new tab.
We tried to create custom app and install on our site by following below commands. We couldn’t see any errors during installation, However, the ERP Next website crashing with Module not found error always.
For additional information, We didn’t add any of our custom code to this app. we simply created new app using the command and tried to install on our site
We are using below versions of ERPNext & Frappe apps -
ERPNext: v15.55.2 (version-15)
Frappe Framework: v15.61.0 (version-15)
Appreciate for any support on this matter?
Installation Steps:
Step1: Changed to bench directory
Step2: bench new-app custom_auth
Step3: bench --site [sitename] install-app custom_auth
Step4: bench --site [sitename] migrate
Step5: bench restart
Step6: bench --site [sitename] clear-cache
Step6: bench --site [sitename] clear-website-cache
Error (while opening website):
ModuleNotFoundError
ModuleNotFoundError: No module named ‘custom_auth’
Traceback (most recent call last)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 100, in application
init_request(request)
^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 173, in init_request
frappe.init(site=site, sites_path=_sites_path, force=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 259, in init
setup_module_map(include_all_apps=not (frappe.request or frappe.job or frappe.flags.in_migrate))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1653, in setup_module_map
for module in get_module_list(app):
^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1501, in get_module_list
return get_file_items(get_app_path(app_name, “modules.txt”))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1466, in get_app_path
return get_pymodule_path(app_name, *joins)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1496, in get_pymodule_path
return abspath(join(dirname(get_module(scrub(modulename)).file or “”), *joins))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1437, in get_module
return importlib.import_module(modulename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.12/importlib/init.py”, line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “”, line 1387, in _gcd_import
File “”, line 1360, in _find_and_load
File “”, line 1324, in _find_and_load_unlocked
During handling of the above exception, another exception occurred:
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1571, in _load_app_hooks
app_hooks = get_module(f"{app}.hooks")
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1437, in get_module
return importlib.import_module(modulename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.12/importlib/init.py”, line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “”, line 1387, in _gcd_import
File “”, line 1360, in _find_and_load
File “”, line 1310, in _find_and_load_unlocked
File “”, line 488, in _call_with_frames_removed
File “”, line 1387, in _gcd_import
File “”, line 1360, in _find_and_load
File “”, line 1324, in _find_and_load_unlocked
During handling of the above exception, another exception occurred:
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/serve.py”, line 19, in get_response
endpoint, renderer_instance = path_resolver.resolve()
^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/path_resolver.py”, line 38, in resolve
resolve_redirect(self.path, request.query_string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/path_resolver.py”, line 117, in resolve_redirect
redirects = frappe.get_hooks(“website_redirects”)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1602, in get_hooks
hooks = _dict(_load_app_hooks())
^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/caching.py”, line 47, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1577, in _load_app_hooks
print(f’Could not find app “{app}”: \n{e}')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
During handling of the above exception, another exception occurred:
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/middlewares.py”, line 16, in call
return super().call(environ, start_response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/env/lib/python3.12/site-packages/werkzeug/middleware/shared_data.py”, line 250, in call
return self.app(environ, start_response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/env/lib/python3.12/site-packages/werkzeug/middleware/shared_data.py”, line 250, in call
return self.app(environ, start_response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 80, in application
app(environ, start_response),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/env/lib/python3.12/site-packages/werkzeug/wrappers/request.py”, line 190, in application
resp = f(*args[:-2] + (request,))
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 133, in application
response = handle_exception(e)
^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/permissions.py”, line 870, in wrapper
return fn(e, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 397, in handle_exception
response = get_response(“message”, http_status_code=http_status_code)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/serve.py”, line 23, in get_response
return handle_exception(e, endpoint, path, http_status_code)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/permissions.py”, line 870, in wrapper
return fn(e, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/serve.py”, line 37, in handle_exception
return ErrorPage(exception=e).render()
^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/page_renderers/error_page.py”, line 7, in init
super().init(path=path, http_status_code=http_status_code)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/page_renderers/template_page.py”, line 45, in init
self.set_template_path()
^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/page_renderers/template_page.py”, line 54, in set_template_path
app_path = frappe.get_app_path(app)
^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1466, in get_app_path
return get_pymodule_path(app_name, *joins)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1496, in get_pymodule_path
return abspath(join(dirname(get_module(scrub(modulename)).file or “”), *joins))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1437, in get_module
return importlib.import_module(modulename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.12/importlib/init.py”, line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “”, line 1387, in _gcd_import
File “”, line 1360, in _find_and_load
File “”, line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘custom_auth’
The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.
To switch between the interactive traceback and the plaintext one, you can click on the “Traceback” headline. From the text traceback you can also create a paste of it.