Www page Error: No module named

I have a simple folder structure within WWW

ImportError: No module named www.index

I thought this would be a better way to organize files but it doesn’t seem to work.

The alternative that works is:


Is this a bug or not how it was intended to be used. Im trying to organize my www folder so perhaps there is an alternate solution. Perhaps i can use routes to achieve the desired url and still have folders.

Where do you get this error?

Let me give my exact example. We have an application and we are overwriting the login. To test I have created


Error from the browser is:

Traceback (most recent call last):
File “/Users/derekbrenner/Dropbox/Frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 32, in render
data = render_page_by_language(path)
File “/Users/derekbrenner/Dropbox/Frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 101, in render_page_by_language
return render_page(path)
File “/Users/derekbrenner/Dropbox/Frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 117, in render_page
return build(path)
File “/Users/derekbrenner/Dropbox/Frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 124, in build
return build_page(path)
File “/Users/derekbrenner/Dropbox/Frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 137, in build_page
context = get_context(path)
File “/Users/derekbrenner/Dropbox/Frappe/frappe-bench/apps/frappe/frappe/website/context.py”, line 18, in get_context
context = build_context(context)
File “/Users/derekbrenner/Dropbox/Frappe/frappe-bench/apps/frappe/frappe/website/context.py”, line 91, in build_context
update_controller_context(context, context.controller)
File “/Users/derekbrenner/Dropbox/Frappe/frappe-bench/apps/frappe/frappe/website/context.py”, line 36, in update_controller_context
module = frappe.get_module(controller)
File “/Users/derekbrenner/Dropbox/Frappe/frappe-bench/apps/frappe/frappe/init.py”, line 668, in get_module
return importlib.import_module(modulename)
File “/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py”, line 37, in import_module
ImportError: No module named login2.index

I have tried this a few ways with simple files as well as with working versions without using index.


import frappe
def get_context(context):


hello {{test}}

Does your login2 folder have an __init__.py file ?


That was the issue. Thank you!!