Dashboard using Flask with dataframe
Alright so i initially created a dashboard with streamlit which displays a dataframe with multiple columns and would let me sort it by parameters. Due to changes to their service my app isn't working anymore.
I recently been looking for alternatives and been trying to wrap my head around flask and i'm curious If it is even possible to do what i'm trying to do.
I have a seperate server running which gathers the data and creates and calculates the dataframes using python logic and stores it every 15 min as a CSV both locally and on a database (using Deta). I would want the flask app to load the csv file every few Minutes or on refresh and display it as a table.
While the first part is rather easy i'm curious If there are options to create an interactive and filterable table. Especialy from a dataframe/CSV file.
So far i got it to output the whole dataframe as a standard bootstrap table. What is the best approach to create a table with it that has Filters, pages and search functions. I imagine i would have to create the Filter function in python logic?
/r/flask
https://redd.it/187eblt
Alright so i initially created a dashboard with streamlit which displays a dataframe with multiple columns and would let me sort it by parameters. Due to changes to their service my app isn't working anymore.
I recently been looking for alternatives and been trying to wrap my head around flask and i'm curious If it is even possible to do what i'm trying to do.
I have a seperate server running which gathers the data and creates and calculates the dataframes using python logic and stores it every 15 min as a CSV both locally and on a database (using Deta). I would want the flask app to load the csv file every few Minutes or on refresh and display it as a table.
While the first part is rather easy i'm curious If there are options to create an interactive and filterable table. Especialy from a dataframe/CSV file.
So far i got it to output the whole dataframe as a standard bootstrap table. What is the best approach to create a table with it that has Filters, pages and search functions. I imagine i would have to create the Filter function in python logic?
/r/flask
https://redd.it/187eblt
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Django model validators don't work in django shell?
I've heard that validators don't work when saving model in django shell?
Does that mean if I use django orm as standalone in some script the validators will also not work?
/r/djangolearning
https://redd.it/187ojon
I've heard that validators don't work when saving model in django shell?
Does that mean if I use django orm as standalone in some script the validators will also not work?
/r/djangolearning
https://redd.it/187ojon
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
Advent of Code 2023 - r/Python Edition
# Join the 2023 Advent of Code Challenge with Python!
Hey Pythonistas! 🐍
It's almost that exciting time of the year again! The Advent of Code 2023 is just around the corner, and we're inviting everyone to join in the fun!
## What is Advent of Code?
Advent of Code is an annual online event that runs from December 1st to December 25th. Each day, a new coding challenge is released—two puzzles that are part of a continuing story. It's a fantastic way to improve your coding skills and get into the holiday spirit!
You can read more about it here.
## Why Python?
Python is a great choice for these challenges due to its readability and wide range of libraries. Whether you're a beginner or an experienced coder, Python makes solving these puzzles both fun and educational.
## How to Participate?
1. **Sign Up/In**.
2. Join the r/Python private leaderboard with code
3. Start solving the puzzles released each day using Python.
4. Share your solutions and discuss strategies with the community.
## Join the r/Python Leaderboard!
We can have up to 200 people in a private leaderboard, so this may go over poorly - but you can join us with the following code:
## How to Share Your Solutions?
You can join
/r/Python
https://redd.it/187t9yq
# Join the 2023 Advent of Code Challenge with Python!
Hey Pythonistas! 🐍
It's almost that exciting time of the year again! The Advent of Code 2023 is just around the corner, and we're inviting everyone to join in the fun!
## What is Advent of Code?
Advent of Code is an annual online event that runs from December 1st to December 25th. Each day, a new coding challenge is released—two puzzles that are part of a continuing story. It's a fantastic way to improve your coding skills and get into the holiday spirit!
You can read more about it here.
## Why Python?
Python is a great choice for these challenges due to its readability and wide range of libraries. Whether you're a beginner or an experienced coder, Python makes solving these puzzles both fun and educational.
## How to Participate?
1. **Sign Up/In**.
2. Join the r/Python private leaderboard with code
2186960-67024e323. Start solving the puzzles released each day using Python.
4. Share your solutions and discuss strategies with the community.
## Join the r/Python Leaderboard!
We can have up to 200 people in a private leaderboard, so this may go over poorly - but you can join us with the following code:
2186960-67024e32## How to Share Your Solutions?
You can join
/r/Python
https://redd.it/187t9yq
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
django on gunicorn and nginx in kubernetes
Hi, i am trying to deploy django app with gunicorn and nginx as reverse proxy in kubernetes while also using ingress in kubernetes. Ingress will have field
/r/djangolearning
https://redd.it/187ikr7
Hi, i am trying to deploy django app with gunicorn and nginx as reverse proxy in kubernetes while also using ingress in kubernetes. Ingress will have field
path so that i can connect to my app by url like www.myexternalip.com/mydjangoapp/ but I don't know what is best way to do it so that I do not have to edit urls.py in my app in order to be able to add any prefix (the /mydjangoapp part to my url) inside the ingress yaml. If i set it without prefix or if i add prefix and then edit urls.py for that same prefix then it works, but I think it is very much not elegant to edit app in order to serve it on arbitrary url.../r/djangolearning
https://redd.it/187ikr7
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
Build, Visualize and Launch Big Data DAGs in Python
https://www.taipy.io/posts/build-visualize-and-launch-big-data-dags
/r/Python
https://redd.it/187m1g6
https://www.taipy.io/posts/build-visualize-and-launch-big-data-dags
/r/Python
https://redd.it/187m1g6
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
How to Deploy Flask App to Vercel for Free
I just wrote a tutorial on how to deploy a Flask app to Vercel for Free as the old tutorials on the Internet don't work anymore since Vercel changed their API.
https://wisecode.blog/deploy-flask-vercel
/r/flask
https://redd.it/187q0p7
I just wrote a tutorial on how to deploy a Flask app to Vercel for Free as the old tutorials on the Internet don't work anymore since Vercel changed their API.
https://wisecode.blog/deploy-flask-vercel
/r/flask
https://redd.it/187q0p7
wisecode.blog
How to Deploy Flask App to Vercel (Free) - WiseCode
Learn how to deploy a Flask app to Vercel for free in simple steps.
If Python is built in C/C++, why can't it be built from source cross-platform?
I was looking into the built from source docs:
https://devguide.python.org/getting-started/setup-building/
And it seems we don't have simple cross platform make command or CLI command.
Why is this so hard to do?
Is there a tutorial where I can compile from source on linux for windows, linux and mac?
/r/Python
https://redd.it/187kr86
I was looking into the built from source docs:
https://devguide.python.org/getting-started/setup-building/
And it seems we don't have simple cross platform make command or CLI command.
Why is this so hard to do?
Is there a tutorial where I can compile from source on linux for windows, linux and mac?
/r/Python
https://redd.it/187kr86
Python Developer's Guide
Setup and building
These instructions cover how to get a working copy of the source code and a compiled version of the CPython interpreter (CPython is the version of Python available from https://www.python.org/). It...
Say it again: values not expressions
https://nedbatchelder.com/blog/202311/say_it_again_values_not_expressions.html
/r/Python
https://redd.it/187j0ai
https://nedbatchelder.com/blog/202311/say_it_again_values_not_expressions.html
/r/Python
https://redd.it/187j0ai
Nedbatchelder
Say it again: values not expressions
Sometimes you can explain a simple thing for the thousandth time, and come away with a deeper understanding yourself. It happened to me the other day with Python mutable argument default values.
Best method to share Python environments on Windows machine
We have a group of users on a single Windows server (using separate accounts) hoping to create, share and use Python virtual environments for their work.
I know Anaconda has a solution for this:
https://docs.anaconda.com/free/navigator/tutorials/manage-environments/
But I'm curious if there is another, better, easier way to do this which will minimize my time as the sysadmin!
Thanks in advance!
/r/Python
https://redd.it/187ztin
We have a group of users on a single Windows server (using separate accounts) hoping to create, share and use Python virtual environments for their work.
I know Anaconda has a solution for this:
https://docs.anaconda.com/free/navigator/tutorials/manage-environments/
But I'm curious if there is another, better, easier way to do this which will minimize my time as the sysadmin!
Thanks in advance!
/r/Python
https://redd.it/187ztin
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Using Flask/connexion for both web and OpenApi server.
Hi Guys, I had this requirement of writing simple web page for this project. It already hosts Openapi server inside a docker container. I thought of using the connexion app server used by openapi to render the web page too.
My question is when I try to fetch the api from the Javascript if I mention the host as localhost it's getting timed out. But if I give container ip it works fine. Currently I am opening the web page in the same host machine. If I open the web page in different machines what should be the host in this case.
/r/flask
https://redd.it/187wkc7
Hi Guys, I had this requirement of writing simple web page for this project. It already hosts Openapi server inside a docker container. I thought of using the connexion app server used by openapi to render the web page too.
My question is when I try to fetch the api from the Javascript if I mention the host as localhost it's getting timed out. But if I give container ip it works fine. Currently I am opening the web page in the same host machine. If I open the web page in different machines what should be the host in this case.
/r/flask
https://redd.it/187wkc7
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
List of Python projects and source code
We Just started a new app that will help beginners to practice and also provide a list of python projects with examples for free.
If you are interested to check out please download it and provide your valuable review. This will be great for us
If you are interested you can download it from the below link
https://play.google.com/store/apps/details?id=com.ideasorblogs.app
/r/Python
https://redd.it/18857ql
We Just started a new app that will help beginners to practice and also provide a list of python projects with examples for free.
If you are interested to check out please download it and provide your valuable review. This will be great for us
If you are interested you can download it from the below link
https://play.google.com/store/apps/details?id=com.ideasorblogs.app
/r/Python
https://redd.it/18857ql
Google Play
Practicepedia - Learn to code - Apps on Google Play
Learn Python, Django, JavaScript and practice projects with video examples
Issues with Pydantic
I've been experimenting with a few Django-related libraries and they all seem to encounter the same problem:
>pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'function'>. Set \\arbitrary\_types\_allowed=True\\ in the model\_config to ignore this error or implement \`\_\_get\_pydantic\_core\_schema\_\_\` on your type to fully support it.\`\`
>
>If you got this error by calling handler(<some type>) within \\\_\_get\_pydantic\_core\_schema\_\_\\ then you likely need to call \`handler.generate\_schema(<some type>)\` since we do not call \`\_\_get\_pydantic\_core\_schema\_\_\` on \`<some type>\` otherwise to avoid infinite recursion.\`\`
The issue occured often when I'm trying to run code that's coming directly from their tutorials, so I'm confused as to whether something changes in Pydantic that's causing these libraries to fail. In this case, I'm testing the `django-ninja` code that appears in their tutorial on `auth` (here):
https://preview.redd.it/06ca60ptsm3c1.png?width=845&format=png&auto=webp&s=60c97d63e8721d4a72e02668165ade278a87c718
/r/django
https://redd.it/1885jie
I've been experimenting with a few Django-related libraries and they all seem to encounter the same problem:
>pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'function'>. Set \\arbitrary\_types\_allowed=True\\ in the model\_config to ignore this error or implement \`\_\_get\_pydantic\_core\_schema\_\_\` on your type to fully support it.\`\`
>
>If you got this error by calling handler(<some type>) within \\\_\_get\_pydantic\_core\_schema\_\_\\ then you likely need to call \`handler.generate\_schema(<some type>)\` since we do not call \`\_\_get\_pydantic\_core\_schema\_\_\` on \`<some type>\` otherwise to avoid infinite recursion.\`\`
The issue occured often when I'm trying to run code that's coming directly from their tutorials, so I'm confused as to whether something changes in Pydantic that's causing these libraries to fail. In this case, I'm testing the `django-ninja` code that appears in their tutorial on `auth` (here):
https://preview.redd.it/06ca60ptsm3c1.png?width=845&format=png&auto=webp&s=60c97d63e8721d4a72e02668165ade278a87c718
/r/django
https://redd.it/1885jie
django-ninja.dev
Authentication - Django Ninja
Django Ninja - Django REST framework with high performance, easy to learn, fast to code.
I made YouTube in Python
https://www.youtube.com/watch?v=GA0621y0zUQ
​
Youtube clone with
1. Views
2. Likes
3. Dislikes
4. Comment
5. Multiple channels under same user
6. Subscribers
/r/Python
https://redd.it/188aa4r
https://www.youtube.com/watch?v=GA0621y0zUQ
​
Youtube clone with
1. Views
2. Likes
3. Dislikes
4. Comment
5. Multiple channels under same user
6. Subscribers
/r/Python
https://redd.it/188aa4r
YouTube
I made YouTube in Python
I made YouTube in Python using the Django web framework. In this video, I give a complete walkthrough of the processes involved in creating this.
PlayLists:
Full Courses:https://www.youtube.com/playlist?list=PLEsIoVbT3urSSqNRek_E6duMUnAIcMqNB
Small Pro…
PlayLists:
Full Courses:https://www.youtube.com/playlist?list=PLEsIoVbT3urSSqNRek_E6duMUnAIcMqNB
Small Pro…
the eval game
https://oskaerik.github.io/theevalgame/
I made a Python game inspired by "The Password Game", highlighting some of the more obscure aspects of the language. Give it a try and test your skills (or maybe creativity...) 😉
I'm happy to receive any feedback!
/r/Python
https://redd.it/1884j69
https://oskaerik.github.io/theevalgame/
I made a Python game inspired by "The Password Game", highlighting some of the more obscure aspects of the language. Give it a try and test your skills (or maybe creativity...) 😉
I'm happy to receive any feedback!
/r/Python
https://redd.it/1884j69
oskaerik.github.io
the eval game
A game testing your Python skills, inspired by The Password Game.
D I'm interviewing Rich Sutton in a week, what should I ask him?
Rich is an author of the RL book, and more recently, he founded the OpenMind Research Institute with some colleagues.
​
The interview is in 1 week. I have a background in RL and already have some ideas on questions and topics, but I also want to source questions outside of the Alberta RL bubble. Technical questions are the best, though I am open to anything. Thank you!
​
I'll post an update in this thread in a couple weeks after the interview is published.
/r/MachineLearning
https://redd.it/187nbv8
Rich is an author of the RL book, and more recently, he founded the OpenMind Research Institute with some colleagues.
​
The interview is in 1 week. I have a background in RL and already have some ideas on questions and topics, but I also want to source questions outside of the Alberta RL bubble. Technical questions are the best, though I am open to anything. Thank you!
​
I'll post an update in this thread in a couple weeks after the interview is published.
/r/MachineLearning
https://redd.it/187nbv8
Reddit
From the MachineLearning community on Reddit
Explore this post and more from the MachineLearning community
Server Error (500) in Production of a Django App on Render.com
I am trying to deploy a Django Application on Render.
In my project, I have some number of apps that have their own
urlpatterns =
path('admin/', admin.site.urls),
path('', include('home.urls')),
path('about/', include('about.urls')),
path('kbdash/', include('management.urls')),
And for every app the url looks like this:
urlpatterns =
path('', about_page, name='about'),
all these urls work except for the
path('kbdash/', include('management.urls'))
Below is the
urlpatterns =
path('', views.Dashboard.as_view(), name='dashboard'),
path('fuels/', views.fuel_list_view, name='fuel_list'),
all the urls in main urls file are working except for the
Visiting
View associated with
class Dashboard(LoginRequiredMixin, generic.View):
/r/django
https://redd.it/1888vns
I am trying to deploy a Django Application on Render.
In my project, I have some number of apps that have their own
urls.py file. Then, in the project's url, I included them. Have a look at the project's url:urlpatterns =
path('admin/', admin.site.urls),
path('', include('home.urls')),
path('about/', include('about.urls')),
path('kbdash/', include('management.urls')),
And for every app the url looks like this:
urlpatterns =
path('', about_page, name='about'),
all these urls work except for the
path('kbdash/', include('management.urls'))
Below is the
urls.py of management app: urlpatterns =
path('', views.Dashboard.as_view(), name='dashboard'),
path('fuels/', views.fuel_list_view, name='fuel_list'),
all the urls in main urls file are working except for the
kbdash/Visiting
kbdash/ and any link under kbdash/ throw Server Error (500)View associated with
kbdash/ :class Dashboard(LoginRequiredMixin, generic.View):
/r/django
https://redd.it/1888vns
Reddit
From the django community on Reddit
Explore this post and more from the django community