Repository: frappe/frappe

Issue:
Tutorial: ModuleNotFoundError: No module named 'frappe.website.generators'
## Description of the issue

While going through the Frappe tutorial, I got stuck after turning on "See on website" option on Article doctype.

After this step, I'm not able to access any page, even login one. I got 500 error code instead, it's about missing `frappe.website.generators` module.

Since I'm not experienced in Frappe, I don't really know how to tackle this problem.

## Context information (for bug reports)

**Output of `bench version`**
```
frappe 14.x.x-develop
library_management 0.0.1
```

## Steps to reproduce the issue

1. Install Frappe using [this instruction](https://frappeframework.com/docs/v13/user/en/installation#debian-ubuntu);
2. Follow the tutorial;
3. Get stuck on [this step](https://frappeframework.com/docs/v13/user/en/tutorial/portal-pages).

### Observed result

All URLs return 500 error code page with stacktrace described above.

### Expected result

See the Article web page.

### Stacktrace / full error message.

```
Traceback (most recent call last):
  File "apps/frappe/frappe/modules/utils.py", line 202, in load_doctype_module
    doctype_python_modules[key] = frappe.get_module(module_name)
  File "apps/frappe/frappe/__init__.py", line 987, in get_module
    return importlib.import_module(modulename)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "apps/library_management/library_management/library_management/doctype/article/article.py", line 5, in <module>
    from frappe.website.generators.website_generator import WebsiteGenerator
ModuleNotFoundError: No module named 'frappe.website.generators'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "apps/frappe/frappe/website/serve.py", line 16, in get_response
    endpoint, renderer_instance = path_resolver.resolve()
  File "apps/frappe/frappe/website/path_resolver.py", line 44, in resolve
    if renderer_instance.can_render():
  File "apps/frappe/frappe/website/page_renderers/document_page.py", line 14, in can_render
    if self.search_in_doctypes_with_web_view():
  File "apps/frappe/frappe/website/page_renderers/document_page.py", line 26, in search_in_doctypes_with_web_view
    condition_field = self.get_condition_field(meta)
  File "apps/frappe/frappe/website/page_renderers/document_page.py", line 89, in get_condition_field
    controller = get_controller(meta.name)
  File "apps/frappe/frappe/model/base_document.py", line 66, in get_controller
    return _get_controller()
  File "apps/frappe/frappe/model/base_document.py", line 52, in _get_controller
    module = load_doctype_module(doctype, module_name)
  File "apps/frappe/frappe/modules/utils.py", line 204, in load_doctype_module
    raise ImportError('Module import failed for {0} ({1})'.format(doctype, module_name + ' Error: ' + str(e)))
ImportError: Module import failed for Article (library_management.library_management.doctype.article.article Error: No module named 'frappe.website.generators')
```

## Additional information

OS version / distribution: Ubuntu 20.04
`Frappe` install method: [this way](https://frappeframework.com/docs/v13/user/en/installation#debian-ubuntu)



Discussion:
Hi, the import path seems wrong in `library_management/doctype/article/article.py` ..there is no `frappe.website.generators.website_generator` i think it should be `frappe.website.website_generator`
ref: https://github.com/frappe/frappe/blob/develop/frappe/website/website_generator.py

and this is definitely a bug as it should happen automatically

https://github.com/frappe/frappe/blob/87adfb5ebd6cca331aca49b3669c7282f41d6a0d/frappe/core/doctype/doctype/doctype.py#L384
I agree, I manually changed import statement for `article` doctype and the website became unfrozen. 

Resolving patch:
diff --git a/frappe/core/doctype/doctype/doctype.py b/frappe/core/doctype/doctype/doctype.py
--- a/frappe/core/doctype/doctype/doctype.py
+++ b/frappe/core/doctype/doctype/doctype.py
@@ -381,7 +381,7 @@ def set_base_class_for_controller(self):
 		document_cls_tag = f"class {despaced_name}(Document)"
 		document_import_tag = "from frappe.model.document import Document"
 		website_generator_cls_tag = f"class {despaced_name}(WebsiteGenerator)"
-		website_generator_import_tag = "from frappe.website.generators.website_generator import WebsiteGenerator"
+		website_generator_import_tag = "from frappe.website.website_generator import WebsiteGenerator"
 
 		with open(controller_path) as f:
 			code = f.read()


Test patch: