[new] Share your Dash App with Others on the Web - Render
ฝัง
- เผยแพร่เมื่อ 21 ส.ค. 2024
- In this video I'll show you the easiest and fastest way to deploy your app to the web, using Dash Tools by Andrew, a Plotly community member.
Join the Community:
charming-data....
The Code:
github.com/Cod...
The app:
dot-offering-s...
Render for Deployment:
render.com/
Dash Tools:
pypi.org/proje...
Plotly Dash Forum:
community.plot...
The Book of Dash:
nostarch.com/b...
************************************************************************
👉 Your support keeps Charming Data running, which is proudly a 100% member-supported educational channel:
Patreon: / charmingdata
GitHub: github.com/spo...
TH-cam: / @charmingdata
Join the Charming Data Community -- charming-data.com/ -- to learn more data viz, data apps, and AI integrations.
Flawless. Easiest deployment tutorial🙌🙌
Thanks Adam! This worked like a charm. Cannot believe how much I've used your videos over the past few years,
Extremely informative video on how to deploy and update the web app. Clear and concise. Thanks!
Thanks for the tutorial! Woked like a charm for a heavy dash app with maps and charts!
Thanks for the video Adam! I had fun working on this project and am looking forward to hearing feedback from the community.
I rely on these types of tutorials to fill in the gaps between written documentation and actual deployment, and your tutorials are very good! It would also be very interesting if you could put up a tutorial for deploying a Dash app to a WordPress site, given that that is such a common platform for websites.
Thank you for the suggestion :)
Great video! Thank you so much for the clear explanation! I come from data science and my knowledge of programming is suboptimal at best. Deploying dashboard apps has always been my nightmare and I was struggling getting my latest app to run due to an endless series of package incompatibility issues. Dashtools and your video allowed me solve the issue instantly and effortlessly. Thank you so much! I hope you'll keep up the amazing content!
you're welcome Thomas. I'm glad the video was helpful. Just be mindful of Dashtools. I'm not sure how often it's been maintained. The last update was from October. Hopefully, it continues working for many years, but keep an eye out.
I just created another video showing how to upload an app to the web with Render. This one is without Dashtools in case you ever need it: th-cam.com/video/q8eBNLc057c/w-d-xo.html
I am so happy to see your videos :) I learned so much, thanks to you and your channel :) After one year of break, I decided to return and master my viz skills! Thank you for keep doing it!
That's great news, @zulfiiaditto4026. Welcome back. Have you built anything with Dash yet?
I was about to request you to post a video like this one! but you already did. wonderful. you're the best Adam.
Hi Adam,
Thanks for this informative video. I can use render now in place of heroku.
With your clear explanation, I could deploy my app easily. Thank you very much.🙂
You're welcome. I'm glad it was helpful.
Thanks for an awesome series of videos. Along with your book, which I started with, they have been so helpful.
Thank you Phillip
Your Dash tutorials are gold, thanks for all these infos!
You're welcome.. thanks for watching
Great tutorial and instructor.
Thank you for sharing🎉
Thank you for watching
Wish I could give this multiple likes. Thank you!!
Thanks for introducing Render, has been very helpful!
However, I think you left out an important part which is to choose the server region. Mine was stuck at deploying for more than an hour (and still running as I wrote this comment...) if done through dash tools, but I restarted another deploy directly on Render's website and chose the correct region (in my case, Singapore), and it was up and running within 5 mins.
For dash tools the default region seems to be Oregon so anyone outside US West might face the same problem as I did.
Thank you. I just pinned a comment about this.
Thank you Adam. It' s so updated and helpful.
I love you!
thank u man, for real
Thank you again!
Hello
Thanks for the great video. I just have a question about the folder structures when we have multiple .py files + .csv files + .css files and .png files in out application. In the video you mentioned that the main app.py file should be located in the src folder, but where do we need to put the rest of files that have been used in the dash app?
Thank you so much in advance for answering my question.
hi Hasan, Here's a great post about structuring a Dash app. community.plotly.com/t/structuring-a-large-dash-application-best-practices-to-follow/62739
Nice tutorial, very useful. It would be very interesting if you could put up a tutorials for:
1. Embedding the plotly dashboards on webpages/websites like the ones we see on news portals during elections.
2. Also which camera and tools are you using for the video😄.
Hi, thanks for the suggestion.
What do you mean embed dashboards on webpages? Dash app is a web page.
I use Logitech camera and filmora video editing
@@CharmingData I think he means cssing the webpage so that the visual display is nice ^^ with its html code, its graphs and everything :)
It would be nice to make a tutorial for deploying a dash app to a local server.
I love your videos, maybe some day you can do a video about the jsme tool to draw molecules in dash,. Thanks for all !!
Thank you for your beautiful tutorial Adam! One question: is it also possible to deploy an Dash app with multiple pages using Render?
Yes it is 🙂
Thank you very much! This will be super helpful! Which tool do you use to record your screen?
I use filmora film recorder. filmora.wondershare.com/screen-recorder.html
Thanks for this vidéo. Merci beaucoup!!!👍
Hi! Want to start by thanking you Adam for your videos, I'm also going to order your new book! :) And now to my question: Is there any way of doing this while having your GitHub repo _private_ instead of public?
Hi @marcsand87.
It appears that private repos are also possible. render.com/docs/github
Wow great help, can i request guide for deploy in aws ec2?
Thanks for the excellent tutorial! Everything was laid very clearly to deploy a dash application. I do have one question though: how do you obtain your DeployWithRender folder that you src/app is in? do we just make our own in our venv? thanks for any help!
Not sure I understand the question. Is this the folder in the github repo?
@@CharmingData @ 1:00 you mention the app.py is in the Deploy with Render Folder, my question is how do I get to that point after creating a working dash app? Thanks for the help!
HI@@Hybritor yes, I just made that folder on my windows machine and called it DeployWithRender, then I created the src folder, and then I made the app.py file and entered the Dash code into that file.
Please attention to the region chosen. Thank you @rubyhu3139.
It's important to choose the server region. Mine was stuck at deploying for more than an hour (and still running as I wrote this comment...) if done through dash tools, but I restarted another deploy directly on Render's website and chose the correct region (in my case, Singapore), and it was up and running within 5 mins.
Hi brother Adam could you please make a video about special features on dash such as the camera cos I need to know them so that I can develop my computer vision project using dash
I just had this problem: the region should be specified inside the render.yaml file (not on Render)
@@user-qr4he6sm9p How would that work specifically? I added a line with 'location: Frankfurt', but it does not seem to be the correct term. Thanks!
@@karelvandenhende6801 It's not 'location', it's 'region'!
Modify it with 'region: frankfurt' and it sould be ok . Note, frankfurt should be with lowercase :) Let me know if it works
PS. Please Adam pin this comment so it can reach many others :)
Btw, it seems Deta is another alternative to Heroku. Would you be interested to check it out? The docs look a bit confusing to a beginner like me. 😄 Happy 2023!
Thanks for sharing that with me.
Good Afternoon Adam
I would love to see a video where you deploy an excel file on render. I have tried it several times without success :(
Thank you for all
hi there, to deploy an app that uses an excel file, try to organize your files this way:
Root folder
----src folder
-------data folder
-----------the excel file
-------init.py file
-------app.py
----Procfile
----requirements
Make sure you can read your excel file into a pandas dataframe before deploying. I think you need to download the openpyxl lirbrary. And include that in the requirements.txt file so that Render knows it needs to install that as well when deploying.
@@CharmingData thank you Adam, i really appreciate your help! Thank you, have a nice day
Nice tutorial, thank you Adam. Quick question, is render just slow or is it Dash?
hi @WayneBruton it's render. Supposedly it speeds up with a paid tier. Dash is fast
@@CharmingData Thank you Adam
Thank you so much Sir!
You're welcome. Thanks for watching
Hi brother Adam could you please make a video for us about the special features on dash such as the camera 📷 cos I need them in my computer vision projects
Thanks
How could I deploy data used in the script? Making a folder 'data' and placing it in GitHub too?
Thanks Adam! I would love to know what you see as the pros/cons of Render vs PythonAnywhere vs Heroku from a Dash app perspective. ( My background is I previously used pythonanywhere as per your excellent video, but my new app has some Async modules which do not seem to be compatible. I signed up to Heroku but then found they do not have local storage. Maybe Render will be the one !)
@Charming Data Hi Adam, Completely off topic but I am not sure if you check out comments on some of your older posts. I have quick question on Chloropleth Maps. Is it possible to import your own topojson file into plotly say for a region not part of the standard maps in plotly. For example, say South Africa and all its provinces (States)?
Hi @waynebruton,
Yes, that should be possible. I think there are examples of that on the Plotly forum
I loved this tutorial, thank you so much! One question: do you know any solution for how to add a simple Login-Page for users? I wouldn't want my Dash App to be public yet. I would either like to invite people by e-mail or create a login for them.
Adding a log in page is not a simple matter. But if you deploy your app with pythonanywhere they offer a built-in username and password for the app that you can share with your users. Only one username and password to enter the app.
Good Afternoon Adam.
I tried to deploy my app but i got the following error;
AttributeError: 'Flask' object has no attribute 'before_first_request'. Did you mean: '_got_first_request'?
Maybe you know what i missing?
Thank you :)
Hello,
What if you try to install flask version 2.2.4
github.com/DataDog/dd-trace-py/issues/5671
@@CharmingData thank you for your prompt response. I will try it. Thank you
Hi @Charming Data ! Thanks for your tutorial. I have built some visualization with dropdowns in plotly using jupyter notebook and the data of that viz will be refreshed every week. How should I deploy this vizs so that if I will share the link they will have the access of vizs only. Thanks in advance!!
Hi Adam, this worked for me, but what happens if your app is going to be used by more than 100 people? Should you choose a payment subscription of Render?
hi Lucas, yes, a payment subscription would be best. But make sure you talk to Render about scalability, especially if many people will be using the Dash app at once. For example, if 10 people are clicking the same dropdown, triggering the same callback, they would have to wait in line to gain access to the callback, depending on how many workers you have set up.
@@CharmingData thanks, I'll contact to the team of render!
Hello, awesome content. I'm starting to learn to visulize data qith python and these videos are sooooooo helpful, thanks a milion. One question, if I have a .env file with my authenticate data which I dont wanna push to github it will be possible create a web service like that?? Thank u again
Sure. Just write in your gitignore file the .env so it doesn't get pushed.
Hi Adam, am looking for help in deploying Python Dash application in Azure. any such video is available, please share. thanks!
Thank you! I am following along and sucessfully pushed the files to github, but the 'Project Requirement: Pushed to GitHub' deployment requirement is not showing the green checkmark. Any thoughts as to why?
It's hard to say. Check if you have installed latest version of dash-tools. Make sure to push your repo to github through the command line or pycharm terminal, rather than copying the files (drag and drop) directly into the repo.
I had similar issue. Path to my project included white spaces. For me, replacing the with spaces with underscores, solved the issue. Maybe you also have whitespaces in the project path?:)
Thanks for the video, was really helpful and I could deploy my app
However, I'm using and upload button where the user will select the excel file to do the analysis on.
For some reason I have not been able to make it work in the deployed version of the app (works fine when running local).
I'm trying to load it by using the following code (from the dash web):
content_type, content_string = contents.split(',')
decoded = base64.b64decode(content_string)
df = pd.read_excel(io.BytesIO(decoded))
and the last line seems to fail for some reason I don't comprehend. Am I missing something or why doesn't this work in the web when it works on my local computer? Thanks in advance
hi, can you please ask this question as a new topic on the Plotly Forum and let me know when you post it. community.plotly.com/
I think there could be a few people I know there that could help you.
Hi! Thanks for the video. Do you know if you can deploy a Dash app on Wordpress? I've tried to put just a static plotly . But would it be possible to put an actual app? It would be great a tutorial about it :)
I'm not sure..I don't think so, but if it's possible, I'll gladly make a video on it. Let me know if you find out before me 😉
Thank you for the great video!
I would like to create an app that uses my own data stored in a file. Where should I store the file?
On a csv sheet is best
@@CharmingData Got my first app with my own data available online *.* Thank you so much for the great video!
Hi Adam, thanks for the video, I am unfortunatley stuck with 'git init'. can you describe the steps needed once I have installed 'Git'..what I have to do.? because now when I write 'git init' from my terminal I got an error. like the command is not reconized..
hi Carlo, I had that happen to me once. I had to reinstall git on my computer and it worked.
Hi, how do I get render to recognise the "assets" folder which contains custom.css and images?
thanks for the great tutorial! i was successfully able to deploy my dash app, but certain features don't work properly. the hover effect on some of the visualisations (like choropleth and bar chart) do not work, and the bootstrap css styling does not load at all. how do i fix this issue?
make sure you declare the bootstrap script inside app = Dash(__name__).
Hello, is it possible to install R on render? I have rpy in my requirements (because I want to generate report in R after button is clicked) but the deploy fails on
"Error: rpy2 in API mode cannot be built without R in the PATH or R_HOME defined. Correct this or force ABI mode-only by defining the environment variable RPY2_CFFI_MODE=ABI"
Did anyone solved it?
Not sure, sorry. I never tried installing R on render. I work in Python.
deberian enseñar publicar en azure este dash seria genial
Hey Adam, thanks for the tutorial! I have to login when I try to create a new repository on the command line. And my login doesn't work... How come you do not have to insert your username and password when doing this?
Are you using dash Tools and it's requiring you to log in?
Hello, I saw your video about how to add password to our dash, and the example was with heroku. How can I do the same with render?
I can not see Quick Setup in Github at 6'12. It does not come up automaticaly. How I can get those code for creating new resitory on the command line?
hi @wiztech2732 . I don't think Dash Tools is up to date anymore. Try deploying your app to the web on render with this video tutorial: th-cam.com/video/H16dZMYmvqo/w-d-xo.htmlfeature=shared
Thanks@@CharmingData
Hello Adam and thank you for your videos, how can I add google analytics to my dash app? I have tried one solution that embeeds it in an html.Script inside the app.layout but it doesn´t seem to work
Hi Sébastian, I've never done that..I'm really not sure.
"Hi, I am looking for a video tutorial on how to deploy my Dash app privately on a section of my website's server, preferably with the option to set up a username and password. Please guide me."
If I wanted to add user profiles where people can log into accounts is this only available as an enterprise feature or is there another way I could do this?
Hey, I'm sure it's possible to figure out how to do it with open source libraries. But it's pretty complicated. Dash Enterprise offers this.
Hi, I don't know if it's on my end or if the video is blurry.
I tested it and I see it clear on my end.
PLS help, i did everything in the video and my app when i run it works but when i click the button it runs an algorithm that calculates some data then it doesn't fill the DASH table, i don't know if it's because i have 4 files in the src folder, but I don't know how to find the error, the code works fine locally
If it runs locally but doesn't run on render, it's probably because the app on render is not able to read the files from the src folder. Can you make your app structure like this and try again?
MyApp
|── src
| |-- app.py
| └── ...
└── data
└── YourCsvFileName.csv
@@CharmingData I have that structure but the same thing keeps happening to me, the app starts and it seems to work but when I start to use it it doesn't fill the tables that it has to fill.
Do I have any way to see step by step what is happening in the code that does not work well in render?
I put all the files together in one and it continues to work fine locally, but the problem is when I load it in render, it doesn't comply with the dash callbacks, it seems to me and that's why it doesn't update the table
@@ianbenjamin1865 I think it has to do with the way that render reads data files
Thank you, man. Great tutorial.
But does anyone in the comment section have this error on the log panel:
"raise exceptions.NoLayoutException(
dash.exceptions.NoLayoutException: The layout was `None` at the time that `run_server` was called.
Make sure to set the `layout` attribute of your application
before running the server.
" ?
I get this error even though I set the app.layout = html.Div(etc). I replaced the bootstrap components with plain html and css, but it still does not work :(
How can I deploy it properly without this error?
Thank you
Does it tell you on what line of code the error was generated?
Thanks a lot Adam, I have this error - FileNotFoundError: [Errno 2] No such file or directory:
hey there,
When do you get that error? Can you provide more information please.
Render will, as Heroku, soon not free available. Is ther's any other solution ?
Moreover how the app manage with mathplotlib ?
Thanks for you videos
I don't think that's completely accurate. I saw that render will raise their costs but they promised to keep their free tier.
If you saw otherwise, can you please share the link that says they will stop offering a free tier.
@@CharmingData thanks for your quick answer.
It will be ok if they still have a free tier.
I tried to push my app but I get this message :
FileNotFoundError: [Errno 2] No such file or directory: 'data/df_clean_newport.csv'
In the scr, I have a data folder with the dataset, a pages folder with the 3 pages and the app
@@christellecornu1039 Hi, I am getting the same error
I managed by connecting to the raw data on GitHub
Looking at Your few quite dash tutorials just made a Dashboard, but I am not able to share the link here.. since youtube will delete comments if I add an external website link😅
I'd love to see your dashboard. You can send it to adam@charming-data.com
Hi Adam does render offer this deployment service for free ?
yes, it does.
Hi, will this also work for multipage app and with a link to external database?
Hi, it should
Hi Adam, i tried all the steps and at the end i got message of failed to deploy. any help
i got the message:
Deploy failed for c29af32: add all my app files
Are you able to view the Render logs for your deploy? There might be some more information there.
@@shoemakerleve9 what do you mean by render logs?
Is the process same for multi page dash app deployment?
It should be similar
I keep getting an error of dashtools: command not found after installing dashtools after successfully installing. Can anyone help me?
What kind of error do you get?
+ dashtools gui
+ ~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (dashtools:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I am using VS studio and it gives me that@@CharmingData
It's necessary to be public?
I don't think so, Italo.
@@CharmingData I deployed my app, don't need to be public.
Thx for the guide!!!
Love it!
@@italobuitron1165 Congratulations :)
Hello!
I have my app.py in the following directory Project/src/app.py. I did install dashtools in the project directory (Project), however every time I want to use the dashtools command (for example, dashtools gui or run). It displays an error saying that the the command is not found (dashtools).
Error: dashtools : The term 'dashtools' is not recognized as the name of a cmdlet, function, script file, or operable program.
Any solution?
Sorry, I'm not sure. Dashtools hasn't been updated by the author in a while, so there might be bugs there.
Hi Adam,
Thank you for the informative video.
My question is regarding enviromnment variables.
I have an api key which I am passing as an an environment variable(in the environment). Later in the source code, I call the api via os.environ.get('api-key'). Not only api key, the data from the api key is stored in to a database and the credentials to this post gres sql database is also passed via environment variable. In the data visualisation, I use sqlAlchemy as an engine to access this database. But sqlAlchemy throws an error:
"sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "None" to address: Name or service not known"
The above error tells me that the os.environ.get('api-key') is giving a none as a outout.
Wondering if you or any one have come accross this error.
Hi Rahul, no i have never came across this error. I'm not sure. Hopefully someone else here can help.
@@CharmingData Thank you. I tried passing these variables directly by hard coding it to the code. It works fines and gets deployed. I guess its something to do with render that is unable to access the environ variables.
Hello! thank you for the tutorial, I have successfully deploy my app. However, when I click the button which pulls data from pg admin (connects to google cloud postgres), it gives me the error: [2023-11-29 22:44:13 +0000] [49] [CRITICAL] WORKER TIMEOUT (pid:62)
Nov 29 02:44:15 PM[2023-11-29 22:44:15 +0000] [49] [ERROR] Worker (pid:62) was sent SIGKILL! Perhaps out of memory?
Nov 29 02:44:15 PM[2023-11-29 22:44:15 +0000] [63] [INFO] Booting worker with pid: 63
Could you provide osme insight onw hat this means? thank you!!
That error could mean a few things. One option is that your calculation is taking more than 15-30 seconds, in which case Render will call a time out and de-active the app
@@CharmingData got it. thank you so much for the help. I have increaes the time out to 1800 seconds and it worked
@@user-dp6dh1yn3cHi, seems that I have a simmiliar problem. Could you tell me where did you increase the time out? I can't find any information about this. Thanks in advance!
@@scolippi4318 You can go to settings and use this gunicorn main:server -t [time1] --keep-alive [time2]
@@scolippi4318 do you still need help?