Hello,
I have create new-app and installed.
sometime it work and sometime it error like this
File “/Users/Dev/frappe-bench/apps/frappe/frappe/website/doctype/web_page/web_page.py”, line 63, in get_context
self.get_static_content(context)
File “/Users/Dev/frappe-bench/apps/frappe/frappe/website/doctype/web_page/web_page.py”, line 187, in get_static_content
with open(self.template_path, “r”) as contentfile:
IOError: [Errno 2] No such file or directory: u’/Users/Dev/frappe-bench/apps/myapp1/myapp1/www/www/myapp1.html’
For more information my source code link as below.
Could you give me some advice?
Best Regards
it seems like your path is wrong u’/Users/Dev/frappe-bench/apps/myapp1/myapp1/w ww/www/myapp1.html’
I think path dose not contain 2 www folder so he can not see file path
I have no www/www in my app structure. but frappe framework try to looking in www/www then the page is error.
App tree structure:
myapp1
├── LICENSE
├── MANIFEST.in
├── README.md
├── license.txt
├── myapp1
│ ├── __init__.py
│ ├── __init__.pyc
│ ├── config
│ │ ├── __init__.py
│ │ ├── __init__.pyc
│ │ ├── desktop.py
│ │ ├── desktop.pyc
│ │ └── docs.py
│ ├── hooks.py
│ ├── hooks.pyc
│ ├── modules.txt
│ ├── myapp1
│ │ ├── __init__.py
│ │ └── __init__.pyc
│ ├── patches.txt
│ ├── public
│ │ ├── build.json
│ │ ├── css
│ │ │ ├── myapp-demo.css
│ │ │ └── myapp1.css
│ │ └── js
│ │ ├── myapp-demo.js
│ │ └── myapp1.js
│ ├── templates
│ │ ├── __init__.py
│ │ ├── generators
│ │ │ └── __init__.py
│ │ ├── includes
│ │ └── pages
│ │ └── __init__.py
│ └── www
│ ├── __init__.py
│ ├── myapp1.html
│ └── myapp1.py
├── myapp1.egg-info
│ ├── PKG-INFO
│ ├── SOURCES.txt
│ ├── dependency_links.txt
│ ├── not-zip-safe
│ ├── requires.txt
│ └── top_level.txt
├── requirements.txt
└── setup.py
Finally, I have found the solution
I have change the file name www/myapp1.html and www/myapp1.py
to www/myapp1_index.html and www/myapp1_index.py
then the problem is solved.
If the html file name is same as the app name (myapp1) the error will show.
you can go to hooks.py an set variable home_page = “myapp1” and keep the preserve name and i think i will work fine