Deploy your App with PythonAnywhere and Dash Plotly

Together, we will deploy your Dash Flask App to the web, using PythonAnywhere. Along the way, you will learn to create a project-app in PyCharm, build a local Git repository, push to GitHub, and clone the repository to PythonAnywhere. As a bonus, we'll search for bugs and add a username and password to the app, so you can share it privately with others.
View my book - The Book of Dash:
www.amazon.com/Python-Dash-An...
github.com/DashBookProject/Pl...
Code:
github.com/Coding-with-Adam/D...
Supporting documentation:
drive.google.com/file/d/1HtJc...
PythonAnyWhere Forum:
www.pythonanywhere.com/forums/
Video layout:
00:00 - What you will learn & download files
01:56 - Create a PyCharm Project
06:54 - Freeze libraries for later
07:44 - Create local Git repository
10:00 - Push your repository to GitHub
12:25 - Clone GitHub repository to PythonAnyWhere
14:49 - Build a PythonAnyWhere Virtual Environment
19:20 - Final PythonAnyWhere configurations
22:30 - Debugging
24:33 - Bonus: Secure HTTPS & username-password
************************************************************************
👉 If you appreciate these tutorials and would like to support their existence and get some perks: Patreon: / charmingdata
GitHub: github.com/sponsors/Coding-wi...
KZread: / @charmingdata

Пікірлер: 120

  • @drpatrickstacey7203
    @drpatrickstacey72032 жыл бұрын

    Thanks Adam, excellent. Since Aug 21 you will all need the PAT (personal access token) when pushing. Cheers

  • @gustavo8433

    @gustavo8433

    2 жыл бұрын

    The console bash dont read my token.

  • @sajidsarkar9574
    @sajidsarkar95742 жыл бұрын

    Thank you so much Adam! This is real solid stuff. Every thing was explained to the detail. Super helpful. Please keep on making such videos. It is difficult to find such awesome videos nowadays because there is so much information clutter out there. Carry on!

  • @kevinnolasco5247
    @kevinnolasco52473 жыл бұрын

    Adam, thanks to your videos I was able to build my first dash app and share it online! Your presentation of the material is so quick and to the point. I appreciate your content!

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    You're welcome, @Kevin. It's s week feeling that first app that we build and deploy. If you'd like to support this channel and my making more of these tutorials, I'd really appreciate it 🙏 www.patreon.com/charmingdata Happy new year to you. And feel free to let me know if you have any dash Plotly questions in the future.

  • @teunerp1335
    @teunerp13353 жыл бұрын

    Hey Adam, Thank you so much for your videos they are great. I solved the error “No such file or directory” by adding the directory in the demo-app.py and adding ecoding=”cp1252’ when reading the csv. For example pd.read_csv ('/home/(name of your pythonanywhere)/demo-3/politics1.csv', encoding='cp1252'). Thanks again for the great content, it is really helpful!

  • @tobiasrohrbach8150
    @tobiasrohrbach81503 жыл бұрын

    Even though I don't really know what I'm doing most of the time, I managed to build my own app thanks to your videos!

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    Thanks Tobias. Can you share a link to your app? I'd love to see it.

  • @fayezhesham1057
    @fayezhesham10572 жыл бұрын

    Thank you, Adam I am really grateful that you do these tutorials I finally have my app up and running and now I can put it in my portfolio. thank you so much

  • @CharmingData

    @CharmingData

    2 жыл бұрын

    You are welcome, Fayez. I'd love to see it if you'd like to share. You can email me at: adam@charming-data.com

  • @carlosmonsivais5101
    @carlosmonsivais51013 жыл бұрын

    Great video, everything worked step by step, clear and concise!

  • @RahulKumar-ey9xl
    @RahulKumar-ey9xl3 жыл бұрын

    Nearing 10k. Lets go. You deserve more subs

  • @mohankumar8523
    @mohankumar85233 жыл бұрын

    I have so much faith on the quality of your video that first I like your video then watch .

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    Thank you, @MOHAN 🤗 I hope you enjoy this one too

  • @brucelee50002000
    @brucelee500020003 жыл бұрын

    I have successfully deployed my first web app in my life from your tutorial. Thank you, Adam.

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    You're welcome @Gia. It's a wonderful feeling. I remember how thrilled I was when I deployed my first app about 1 year ago. Congratulations 👏 Hope you benefit and continue learning from the other tutorials in this channel

  • @brucelee50002000

    @brucelee50002000

    3 жыл бұрын

    @@CharmingData One more good thing here, your word document is the best to track what I do if I lost when working with a lot of stuff. This is a great and highlight idea from you to distinguish other channels.

  • @jgupman
    @jgupman2 жыл бұрын

    you are the best! just got my first web app deployed!

  • @ahmadzakysaid9198
    @ahmadzakysaid9198 Жыл бұрын

    Thx a lot!! I have successfully deployed my first web dash, thx to you!!

  • @mathiasschindler4165
    @mathiasschindler4165 Жыл бұрын

    Wow! Amazingly helpful and well-explained. Thank you so much!!

  • @CharmingData

    @CharmingData

    Жыл бұрын

    You're welcome Mathias

  • @Joe-ps7em
    @Joe-ps7em Жыл бұрын

    This was VERY HELPFUL!

  • @luckysrivastava798
    @luckysrivastava7983 жыл бұрын

    ❤️❤️❤️ Love from india🇮🇳 bro keep it up👍👍👍

  • @aftotto
    @aftotto3 жыл бұрын

    Big fan of your videos. They have helped me a lot

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    I'm glad @aftotto.

  • @Truesilverful
    @Truesilverful3 жыл бұрын

    This is priceless, thank you. Well worth it to be patreon!

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    Thank you

  • @CharmingData
    @CharmingData3 жыл бұрын

    Hi Everyone, to follow along, don't forget to save this step-by-step guide: drive.google.com/file/d/1HtJcu3ZWsDYEIv8srod16z4jD4HEeHuH/view To join my Patreon community for more on Dash Plotly: www.patreon.com/charmingdata Feel free to ask any questions if something doesn't work for you when uploading your app.

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    @Olta Klosi Olta, try looking at the elections.py file I put on GitHub. Under the df = read_csv()... line, I show another option where you can outline the needed path.

  • @pritamkashyap4077
    @pritamkashyap4077 Жыл бұрын

    Awesome. Keep up the good work

  • @Ijiljili
    @Ijiljili3 ай бұрын

    Excellent tutorials. Amazing teaching skills. Thank you very much.

  • @CharmingData

    @CharmingData

    3 ай бұрын

    You're welcome. I'm glad you like it. Don't forget to join our Charming Data community if you'd like to work on data apps and AI together with others. charming-data.com/

  • @DILASTUDIO
    @DILASTUDIO3 жыл бұрын

    your video is really helpful , using your tutorial I'm able to make my first dashboard with python. thank you so much. keep it up, i hope you can make more new tutorials :)

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    Thank you @Fadhilah. Good luck with your next dashboard 🤗

  • @insideio
    @insideio Жыл бұрын

    You made my day sir, thanks a lot

  • @ShaiSussman
    @ShaiSussman3 жыл бұрын

    Thank you Adam!

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    you're welcome @Shai

  • @samiryahiaoui
    @samiryahiaoui2 жыл бұрын

    Excellent tutorial!

  • @CharmingData

    @CharmingData

    2 жыл бұрын

    Thank you Samir

  • @blociot
    @blociot3 жыл бұрын

    Thank you Adam. Perfect as always. Any chance to create a video to talk about basic security topics when deploying the app? I understand https is the first one, but what else do we need to do to make sure someone doesn't take our app down?

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    Hi @Mos. Thanks for watching. I'll look into it. I'm not an expert in website security, but I'll read more about it.

  • @Aditya.Santra
    @Aditya.Santra2 жыл бұрын

    Very Helpful Video

  • @Qzbub
    @Qzbub Жыл бұрын

    dude you are the best ❤❤

  • @graficasderanking9715
    @graficasderanking97152 жыл бұрын

    Great video. It would be a good video of How to deploy the dash app to an private local server or in a virtual machine

  • @ahmadnadeem870
    @ahmadnadeem8708 ай бұрын

    Thank Adam, i have created a dash app by watching you videos. i enjoyed a lot while following the steps and having wonderful results. i have a question, what if i want to deploy the app on a private server instead of git etc?

  • @moeezsaleem7072
    @moeezsaleem70723 жыл бұрын

    Your amazing:), great content.

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    Thank you @Moeez

  • @energyrogue
    @energyrogue11 ай бұрын

    Thank you for all of your tutorials - these are amazing!! One question - can you have a second web app? how would that be managed with the 'mysite'....that part confuses me

  • @amir_forooghi
    @amir_forooghi3 жыл бұрын

    great tutorial . Very energetic and easy to understand. Thanks Adam. Big like for you =D

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    Thank you Amir.

  • @amir_forooghi

    @amir_forooghi

    3 жыл бұрын

    @@CharmingData Welcome. Adam can you give me your opinion about this link? stackoverflow.com/questions/65384985/automatic-scaling-of-y-axis-in-dash-according-to-the-relayoutdata-attribute

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    @@amir_forooghi Amir, do you have this app on stackoverflow live so I can see it and play with the zoom?

  • @amir_forooghi

    @amir_forooghi

    3 жыл бұрын

    @@CharmingData If you just paste the code in your IDE, It will run. The dataframe is on github so pandas can read it.

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    @@amir_forooghi I just answered you on stackoverflow

  • @veason123
    @veason1233 жыл бұрын

    Hi Adam! Great video! Learnt a lot from you! While I deploying my dash app to the pythonanywhere, I got this issue: ModuleNotFoundError: No module named 'elections'. I tried to pip install elections. But I got an error also: No matching distribution found for election. Any idea how should I fix this problem? thanks!

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    Hi @Diao I've never had that problem. At what stage does it occur?

  • @Smart-sv8jb
    @Smart-sv8jb2 жыл бұрын

    Thank you so much! Can you produce files with data in Json format.

  • @mdaplaton
    @mdaplaton2 жыл бұрын

    Thx for the content! Is it possible to grant access to different users with different usernames and psw?

  • @CharmingData

    @CharmingData

    2 жыл бұрын

    yes, you can do that with Dash authentication on a basic level: dash.plotly.com/authentication

  • @ivochula
    @ivochula3 жыл бұрын

    Hi Adam, Thank you for your tutorial. I have learned a lot with your videos and i am developing a dashboard to help in my company only by learning with your videos and documentation. One question, my dashboard loads its data from a excel sheet, how can i update my dashboard (already deployed) everytime the excel sheet is modified?

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    Hi @Ivo, one way to do that is to connect the excel sheet to a live database like Mongo or PostgreSQL, because you can connect the database to Dash. And with a dcc.Interval, the app can pull data from the database every x amount of time. Dash cannot pull info from an excel sheet live, because an excel sheet is static.

  • @ivochula

    @ivochula

    3 жыл бұрын

    @@CharmingData Thank you Adam, i will check that option with a Database and maybe i'll develop a User Interface Dash to replace the Excel sheet and the user will introduce the data directly to the database via User Interface.

  • @luisbernal3534

    @luisbernal3534

    2 жыл бұрын

    I have the same question. It would be cool to make a video about it. Your content has been extremely useful for my work. Cheers from Colombia!

  • @josueyoon5156
    @josueyoon51563 жыл бұрын

    Thanks for this awesome tutorial. I have a question about the data that feeds the dash. Now I am reading my csv files locally but if I want to deploy it in a web (using python anywhere or heroku) from where should I have to read my files if I want to keep those private? Thanks!

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    Do you mean you prefer having a private GitHub repository?

  • @josueyoon5156

    @josueyoon5156

    3 жыл бұрын

    @@CharmingData I want to deploy a dash with a confidential data. Does a private repository guarantee the confidentiality of my data? Should a have to read my files with a token that provides github right?

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    @@josueyoon5156 there is always risk in having confidential data on your app unless you're a data security expert. That's why companies will higher data security experts to ensure their data safety. But those companies still get hacked. That's to say you can never secure your data 100% but making your GitHub private will help

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    I'm sure there are other ways to secure your data online. It has less to do with Dash and more to do with your file structure and server you're using.

  • @josueyoon5156

    @josueyoon5156

    3 жыл бұрын

    @@CharmingData thank you so much for your reply!!

  • @nilanjanaghosh7032
    @nilanjanaghosh70323 жыл бұрын

    Hi, getting the error ERROR: Could not find a version that satisfies the requirement pywin32==300. Can someone please help?

  • @akaAntifa
    @akaAntifa Жыл бұрын

    hi, thanks for all! I'm going to see all your videos various times. I use visual studio community, and cant find the way to have the terminal activated with the virtual environment. Do you know how to do that?

  • @CharmingData

    @CharmingData

    Жыл бұрын

    Hi Javier I'm sorry but I don't use visual studio community

  • @eduardomurphyperez717
    @eduardomurphyperez7173 жыл бұрын

    Hi Adam, I am also having problem with the data amount (using more than 500 Mb), I am trying to deploy an app (not the one that you are posting here) made in dash, and I was wondering... if python anywhere is cloning from the repository, why do you need to reinstall all the libraries in the requirements.txt?

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    hi Eduardo. The requirements dot txt file is just a list of library names that pythonanywhere can use to install the libraries.

  • @nishantkumar-lw6ce
    @nishantkumar-lw6ce Жыл бұрын

    What’re the best ways to deploy open source plotly dash app on AWS? What services can we use to deploy there if we have to avoid enterprise edition?

  • @CharmingData

    @CharmingData

    Жыл бұрын

    hi Nishant, I honestly don't know. I've only deployed a Dash app on Heroku, Pythonanywhere and Render

  • @thousandsunny100
    @thousandsunny1003 жыл бұрын

    Very helpful tutorial! Can you please create another tutorial on how to deploy the same on a linux server (VPS)? Thank you in advance! Subbed!

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    Thanks for the suggestion, @Emil

  • @NanaOkyere
    @NanaOkyere3 жыл бұрын

    Good share

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    Thank you Nana. Let me know if you have questions along the way

  • @raviramadas4313
    @raviramadas43133 жыл бұрын

    Hi Adam, thanks a lot for this video. This this is better than heroku. Is there anyway I can host dash apps on my local network server? Appreciate if you have any pointers on this.

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    Hi Ravi, there is a way but it's complicated and I haven't done it. But you could always create an app on pythonanywhere and add a password to it

  • @xjp
    @xjp3 жыл бұрын

    Excellent video. BTW I believe it should be pip3 and not pip,.

  • @reinierdick6181
    @reinierdick6181 Жыл бұрын

    I dont get it. I add the .gitignore file as the video explains and still this is uploaded to the repository, what am i doing wrong

  • @rowflake130
    @rowflake1303 жыл бұрын

    This is binge watching material *.*

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    🤣🤣🤣 Thank you

  • @HeroSphereTCG
    @HeroSphereTCG3 жыл бұрын

    Can you embed a pythonanywhere app on your own website? I created a game in python and want to host it on my own website.

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    Hi. I don't think. I haven't tried that.

  • @osamakidwai8912
    @osamakidwai89122 ай бұрын

    Hi, When I type git init, git add and git commit commands, it shows me an error in pycharm. Can someone guide regarding it?

  • @CharmingData

    @CharmingData

    2 ай бұрын

    what error do you get?

  • @mackas33
    @mackas333 жыл бұрын

    Thanks for this awesome tutorial, otherwise I get this error "ERROR: Could not install packages due to an OSError: [Errno 122] Disk quota exceede"

  • @shrikanttyagi8798
    @shrikanttyagi87982 жыл бұрын

    Again sir how this display same page in android apk? I need android apk deploy code .. please sir share or make one video

  • @its_me7363
    @its_me73633 жыл бұрын

    This hosting website gives only 512 Mb of storage space...sometimes it might not be enough...is there any website which gives more space and RAM for free than this?

  • @CharmingData

    @CharmingData

    3 жыл бұрын

    Hi @its_me. You can get more space if you pay &5 a month. I don't know any other hosting platform that will give you more than 512mb for free accounts. Does anyone else here know? Please help @its_me if you do.

  • @theinstigatorr
    @theinstigatorr3 жыл бұрын

    This is much more hassle than heroku but at least it works for me rather than the errors I get on that platform

  • @returntonature7320
    @returntonature7320 Жыл бұрын

    Hello adam Thanks for your great tutorial🙏🏻 please teach us how to deploy our dash app on a local server like company's domestic servers without Internet! As far as I know dash app will not work only by changeing host and port in app.run_server() How should we deal with this? Thank you so so much🎉

  • @shrikanttyagi8798
    @shrikanttyagi87982 жыл бұрын

    Graph menu how disable plotly hyper link..?

  • @CharmingData

    @CharmingData

    2 жыл бұрын

    if you're referring to disable the logo, you can use the config prop inside the dcc.Graph like this: dcc.Graph(... config={"displaylogo": False})

  • @shrikanttyagi8798

    @shrikanttyagi8798

    2 жыл бұрын

    @@CharmingData thanks sir

  • @shrikanttyagi8798

    @shrikanttyagi8798

    2 жыл бұрын

    @@CharmingData I am asking for graph inbuild menu .. picture,zoom in, zoom out,pen,box,plotly hyper link .. just want only one item plotly hyper link should not display.

  • @CharmingData

    @CharmingData

    2 жыл бұрын

    @@shrikanttyagi8798 yes, that's the way to do it.

  • @shrikanttyagi8798

    @shrikanttyagi8798

    2 жыл бұрын

    @@CharmingData great sir.. please also make video on how to make android apk which display dash and plotly chart

  • @HeiderZapata
    @HeiderZapata2 жыл бұрын

    Hi friend, I don't uderstand what happened in the minute 21:14 to 22:16. My python file is called app.py so I'm doing this: from app import app application = app.server and i'm having this error: 2022-05-28 02:55:49,870: Error running WSGI application 2022-05-28 02:55:49,872: NameError: name 'app' is not defined 2022-05-28 02:55:49,872: File "/var/www/heiderzapata_pythonanywhere_com_wsgi.py", line 17, in 2022-05-28 02:55:49,872: application = app.server ¿why? you wrote: from elections import app application = app.server because your python file is called elections. Thanks for your help friend

  • @CharmingData

    @CharmingData

    2 жыл бұрын

    Hi Heider, try to change the name of your folder from app to something else. It's ok if the name of the app is app.py, but the folder should have a different name,

  • @Elcunato
    @Elcunato2 жыл бұрын

    Hello Adam, thank you very much for your video! One thing though, in my app I'm using a chorepleth map with a .geojson file. On my local computer, I then needed to pip install geopandas after installing the wheels for Fiona and GDAL. But when I'm using the bash on PythonAnywhere, it displays this: ERROR: Fiona-1.8.21-cp39-cp39-win_amd64.whl is not a supported wheel on this platform. And on my requirements.txt, I have this associated line: Fiona @ file:///C:/Users//PycharmProjects//venv/Lib/site-packages/Fiona-1.8.21-cp39-cp39-win_amd64.whl Same for GDAL. What should I do?

  • @CharmingData

    @CharmingData

    2 жыл бұрын

    Hi Kevin, I'm afraid it's a pythonanywhere thing. You either find a different way to plot your choropleth or you can try to use Heroku. Look at dash-tools on pypi an easy Heroku deployment

  • @Elcunato

    @Elcunato

    2 жыл бұрын

    @@CharmingData thank you for your quick answer! I’ve contacted the support team at PythonAnywhere, they’re using Linux. I’ll see if there’s something I can edit in my requirements.txt file and if this is not working I’ll opt for the alternative you’ve recommended me. Thank you so much for your videos, It’s my first time creating a Dash app and your videos are gems.

  • @ahmadnadeem870
    @ahmadnadeem8708 ай бұрын

    Thank Adam, i have created a dash app by watching you videos. i enjoyed a lot while following the steps and having wonderful results. i have a question, what if i want to deploy the app on a private server instead of git etc?

  • @CharmingData

    @CharmingData

    7 ай бұрын

    I've never done that, sorry. But I've heard people with private servers do it.