Results 1 to 6 of 6

Thread: Possible to generate a Ext JS project from Architect then be used in a Flask project?

  1. #1
    Sencha Premium Member
    Join Date
    May 2014
    Posts
    10

    Default Possible to generate a Ext JS project from Architect then be used in a Flask project?

    I tried to use Arthitect to generate a CarListing sample project, then copy the whole folder to Flask project's static folder, then copy the index.html to Flask's templates folder & modified the urls. When I start my Flask application and browse the web from Chrome, nothing happened. Seems bootstrap.js is still trying to load all the js files from /ext/* folders not /static/CarListing/ext/*. How can I make it work?

  2. #2
    Sencha User
    Join Date
    Jan 2009
    Location
    Frederick, Maryland
    Posts
    925
    Answers
    66

    Default

    Quote Originally Posted by haha001 View Post
    I tried to use Arthitect to generate a CarListing sample project, then copy the whole folder to Flask project's static folder, then copy the index.html to Flask's templates folder & modified the urls. When I start my Flask application and browse the web from Chrome, nothing happened. Seems bootstrap.js is still trying to load all the js files from /ext/* folders not /static/CarListing/ext/*. How can I make it work?
    Not sure it would work "just like that." Did you look in your Chrome console for errors?
    Jason Minnick
    Sencha Architect Development Team

  3. #3
    Sencha Premium Member
    Join Date
    May 2014
    Posts
    10

    Default yes there are some error from Chrome debug

    ??.PNG
    I did changed the appFolder as below. but looks like it's not working.
    Ext.application({
    appFolder: '/static/CarListings/app',

  4. #4
    Sencha User
    Join Date
    Jan 2009
    Location
    Frederick, Maryland
    Posts
    925
    Answers
    66

    Default

    Quote Originally Posted by haha001 View Post
    ??.PNG
    I did changed the appFolder as below. but looks like it's not working.
    Ext.application({
    appFolder: '/static/CarListings/app',
    Looks like your mapping is off. 'app' is not in the root of your web server according to the folder structure (I assume).
    Jason Minnick
    Sencha Architect Development Team

  5. #5
    Sencha Premium Member
    Join Date
    May 2014
    Posts
    10

    Default

    Quote Originally Posted by jminnick View Post
    Looks like your mapping is off. 'app' is not in the root of your web server according to the folder structure (I assume).
    what does 'mapping is off' mean? Do you mean there is something wrong with what I do with my Flask application (not need to modify anything on the CarListing folder of Ext JS)?


    I uploaded my code to github at
    [email protected]:zhongzhu/extjs_flask_integration.git

    I'd appreciated it if you could spend a minute to help have a look. Thanks in advance! And I'll review the Flask user guide to see if there's something I missed to configure it.

  6. #6
    Sencha Premium Member
    Join Date
    May 2014
    Posts
    10

    Default

    It turns out to be a Flask issue, we need to serve the static files from Flask like [email protected]('/app/
    ')def static_proxy(path): # send_static_file will guess the correct MIME type return app.send_static_file(os.path.join('CarListings/app', path))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •