2

I have following folder structure for my project. I am using ExtJS, Sencha Cmd and Flask to start this project.

Tools/Framework used for UI

Sencha Cmd v6.2.1.29
Ext JS v6.2.1

I have successfully created UI for a sample login app. I have used some hardcoded username and password verification, and it has worked as expected.

However I tried to implement with my webserver which is created using Flask. I modified my application folder structure as following.

project
│   run.py
│
└───static
│   │   ext/ <--- all extjs files here
│   │   app/ <--- my application folder
|   |   index.html
│   │   ...
└───templates
    │   index.html

After executing my flask application, I had a problem. Files required by ExtJS which is app.js, bootstrap.json both are loaded as expected. But it gives error in network saying file not found for ExtJS files. It is expected to ask for file inside static folder, but the request is made in app root directory /ext/build/ while it should have been /static/ext/build/

I just want to append /static/ in every request to ExtJS files. Is there any way of doing this? Or what am I doing wrong?

If I run index.html file located inside static folder, the UI works fine since the path for core ExtJS file matches.

I have followed this link for my app.

IT.dumb
  • 71
  • 6
  • You may try to find an answer to your question in this thread http://stackoverflow.com/a/24933464/1018686 , particularly solving the issue by changing classpath variable in app.json – fen1ksss Mar 13 '17 at 09:49
  • actually it got solved by changing `indexHtmlPath` path to my `../templates/index.html' path relative to `app.json` file. Though `"indexHtmlPath": "../index.html"` also solved the issue and it looked cleaner, I have used this settings. But I should use `"indexHtmlPath": "../templates/index.html"` just be clear the next time which index.html file is being used – IT.dumb Mar 13 '17 at 15:10

1 Answers1

1

Changing entry from app.json file did solve my issue.

I used relative path from app.json path to point the index.html file that is being used to call the bootstrap.js file. e.g.

"indexHtmlPath": "../templates/index.html"

This way every file used by extjs framework is automatically pointed to right path. All the extjs file path was relative to the index.html file.

IT.dumb
  • 71
  • 6