Domino and Dash

puggelli_vladimiropuggelli_vladimiro Member Posts: 6

Hi all,

I need to import my css file in my dash app on domino.

This is the page to refer for import css in dash app:

Obviously, do not work on Domino.

Thanks for support.

Tagged:

Comments

  • puggelli_vladimiropuggelli_vladimiro Member Posts: 6

    Some additional info.

    On dash app i define:

    app = dash.Dash(__name__)

    and create assets directory where I put my css file.

    I recreate this structure on my domino projects but do not work. Some advice?

    Thanks again.

  • akshay.ambekarakshay.ambekar Administrator, Moderator, Domino Posts: 19 admin
    edited January 13

    Hello!

    Thanks for your question.

    If you are having trouble getting your CSS to work you may need to set an external path to it. Here is the code to do that if it's stored in an assets folder:

    import os
    
    runID = os.environ['DOMINO_RUN_ID']
    user = os.environ['DOMINO_PROJECT_OWNER']
    project = os.environ['DOMINO_PROJECT_NAME']
    
    assets_path = '<Domino url>'+ user + '/' + project +'/r/notebookSession/' + runID + '/assets/'
    
    #set the external path to the assets folder
    app = dash.Dash(assets_external_path = assets_path)
    

    Here is more information on using Dash Apps in Domino: https://community.dominodatalab.com/discussion/comment/140 and https://docs.dominodatalab.com/en/3.6/reference/publish/apps/Getting_started_with_Dash.html

  • puggelli_vladimiropuggelli_vladimiro Member Posts: 6

    Thank you very much for your support. It work very well!

  • freihofer_isabel_brownfreihofer_isabel_brown Member Posts: 1
    edited January 7

    Hi,

    I am running into the same problem and the solution above did not work for me. I am working on Domino 3.5.7. Do you have any other suggestions?


    I currently have my python script in my project folder and then I have an assets folder in my project folder as well. My CSS file is in my asset folder.

  • tayler.saletayler.sale Member, Moderator, Domino Posts: 28 mod

    Hi Isabel,

    Sorry the above solution is not working for you. I'm not sure what version of Dash you are using or what particular specifications in your project that might be helpful context for sorting this out. I would suggest you submit a Support ticket so that someone can be assigned to your issue and work to troubleshoot it directly with you. Just send an email to [email protected] with the details and we would be happy to help. :)

Sign In or Register to comment.