Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Dash in Flask #263

Merged
merged 5 commits into from
Aug 8, 2024
Merged

Integrate Dash in Flask #263

merged 5 commits into from
Aug 8, 2024

Conversation

bchen39
Copy link
Contributor

@bchen39 bchen39 commented Aug 5, 2024

Please also check the links to my test applications, using app context and middleware

Closes ploomber.io#198


📚 Documentation preview 📚: https://ploomber-doc--263.org.readthedocs.build/en/263/

Copy link
Contributor

@bryannho bryannho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bchen39 one comment, also please let us know when the blog is ready too

examples/flask/dash-in-flask/README.md Outdated Show resolved Hide resolved
@bchen39 bchen39 requested a review from bryannho August 6, 2024 15:03
Copy link
Contributor

@bryannho bryannho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG overall one small change

examples/flask/dash-in-flask/README.md Outdated Show resolved Hide resolved
@neelasha23
Copy link
Contributor

I think it would be better to organize the code files into 2 subfolders: app_context and middleware, each containing its complete set of files. @bchen39

@bchen39
Copy link
Contributor Author

bchen39 commented Aug 6, 2024

@neelasha23 @bryannho Based on Neelasha's suggestion, I will organize my code into 2 folders: app_context and middleware. Each of the folder will contain the following:

  • app.py
  • dash_apps/simple_app.py
  • dash_apps/population.py
  • requirements.txt

I will also put the images in a separate folder but leave the README in the main folder

To upload, the user can zip the content in the folder or directly deploy the app in the command line. The user won't need to cp and ignore with this setup.

I will update the content in my blog as well. Let me know if this works!

@bchen39
Copy link
Contributor Author

bchen39 commented Aug 7, 2024

I realized earlier that I had misunderstood the fundamental difference between the two approaches:

  • The middleware option can also use application context to share Flask data.
  • The real difference is whether we are hosting the Dash apps on the server or mounting these apps separately using a Middleware.

I have made the changes to the project structure and rewrote my README. Please check the web apps: middleware approach and the hosting approach. I will also reflect on these changes in my blog. Let me know if you have other questions or comments.

@bryannho bryannho requested a review from neelasha23 August 7, 2024 21:10
Copy link
Contributor

@bryannho bryannho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG overall, I think the change makes a lot of sense. Small comments

examples/flask/dash-in-flask/README.md Outdated Show resolved Hide resolved
examples/flask/dash-in-flask/README.md Outdated Show resolved Hide resolved
@bryannho
Copy link
Contributor

bryannho commented Aug 8, 2024

@bchen39 is this ready for review?

@bchen39 bchen39 requested a review from bryannho August 8, 2024 14:48
@edublancas edublancas merged commit 1bc511b into main Aug 8, 2024
1 check passed
@edublancas edublancas deleted the dash-in-flask branch August 8, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants