Flask app requires restart to display new database records on the page
I'm a bit new to flask and have run into an issue that I haven't been able to remedy.I've got a form in one my templates that allows the user to enter a URL and an accompanying label. Submitting this adds a record to my database for the new link. I have a for loop in my template that loops through the records in the database and displays them on the page. Everything is working correctly, but when I submit the link it does not display on my page even after reloading the page. Instead, I have to close my flask app an re-run it in order to see the newly added links on my page. The same goes for editing or deleting these links, which I also have actions for.
In summary, database changes are not seen on my page until I reload my flask app.
If my sql app/templates/static files are needed in order to help let me know. Thanks!
App code -
***https://www.ppaste.org/JOTQf88vj***
/r/flask
https://redd.it/iuv3zx
I'm a bit new to flask and have run into an issue that I haven't been able to remedy.I've got a form in one my templates that allows the user to enter a URL and an accompanying label. Submitting this adds a record to my database for the new link. I have a for loop in my template that loops through the records in the database and displays them on the page. Everything is working correctly, but when I submit the link it does not display on my page even after reloading the page. Instead, I have to close my flask app an re-run it in order to see the newly added links on my page. The same goes for editing or deleting these links, which I also have actions for.
In summary, database changes are not seen on my page until I reload my flask app.
If my sql app/templates/static files are needed in order to help let me know. Thanks!
App code -
***https://www.ppaste.org/JOTQf88vj***
/r/flask
https://redd.it/iuv3zx
Paint with Machine Learning: a Semantic Image Synthesis Demo
[Paint with Machine Learning](http://paintwith.spell.ml/) is a semantic image synthesis (or image-to-image translation) demo application I built as a consulting project. Hand-drawn semantic segmentation maps go in, [GauGAN](https://arxiv.org/abs/1903.07291) generated images ([NVLab/SPADE](https://github.com/NVlabs/SPADE)) come out.
I trained the model on [ADE20K](https://www.kaggle.com/residentmario/ade20k-outdoors) and fine-tuned it on [a dataset of Bob Ross paintings I hand-labelled](https://www.kaggle.com/residentmario/segmented-bob-ross-images). The model generates [some nice-looking results](https://i.imgur.com/wGwNAh6.png), considering I had just 250 paintings to work with, albeit at a very low resolution, just 256 by 256 pixels.
The application and model code is in [a public GH repo](https://github.com/spellml/paint-with-ml).
/r/Python
https://redd.it/iumcxq
[Paint with Machine Learning](http://paintwith.spell.ml/) is a semantic image synthesis (or image-to-image translation) demo application I built as a consulting project. Hand-drawn semantic segmentation maps go in, [GauGAN](https://arxiv.org/abs/1903.07291) generated images ([NVLab/SPADE](https://github.com/NVlabs/SPADE)) come out.
I trained the model on [ADE20K](https://www.kaggle.com/residentmario/ade20k-outdoors) and fine-tuned it on [a dataset of Bob Ross paintings I hand-labelled](https://www.kaggle.com/residentmario/segmented-bob-ross-images). The model generates [some nice-looking results](https://i.imgur.com/wGwNAh6.png), considering I had just 250 paintings to work with, albeit at a very low resolution, just 256 by 256 pixels.
The application and model code is in [a public GH repo](https://github.com/spellml/paint-with-ml).
/r/Python
https://redd.it/iumcxq
paintwith.spell.ml
Paint with Machine Learning
Create a landscape painting in the style of Bob Ross using machine learning.
App with 2 ports. One port needs to be private, how to accomplish?
An application has a costumer side which is publicly available, in development is running on port 5000. Now we want an admin panel that is online but not accessible to the general public only admin staff as with this panel you can modify directly the database and make big changes. It's running on port 5001
Im exploring 3 possibilities.
\+ One involves making a username and password plus using MFA like the guy in this [video](https://www.youtube.com/watch?v=kMTXL5FUHGM&ab_channel=MiguelGrinberg). to access the admin panel.
\+ The second is adding admins via invitation, which is somewhat similar like the above and my question is how to add the first admin user to send invitations. (same question applies to the first option).
\+ The third one someone at work mention SSH tunnelling, Im yet to look into this one deeply but wonder if anyone here has any opinion about it and it's ease of implementation.
If anyone has any tips or better potential solutions I'd love to hear about it.
(Bonus question) The admin panel is running in port5001 so we have [app.py](https://app.py) and [app2.py](https://app2.py) in one project. But in order to run it in parallel I used threading and that disabled
/r/flask
https://redd.it/iv0pl2
An application has a costumer side which is publicly available, in development is running on port 5000. Now we want an admin panel that is online but not accessible to the general public only admin staff as with this panel you can modify directly the database and make big changes. It's running on port 5001
Im exploring 3 possibilities.
\+ One involves making a username and password plus using MFA like the guy in this [video](https://www.youtube.com/watch?v=kMTXL5FUHGM&ab_channel=MiguelGrinberg). to access the admin panel.
\+ The second is adding admins via invitation, which is somewhat similar like the above and my question is how to add the first admin user to send invitations. (same question applies to the first option).
\+ The third one someone at work mention SSH tunnelling, Im yet to look into this one deeply but wonder if anyone here has any opinion about it and it's ease of implementation.
If anyone has any tips or better potential solutions I'd love to hear about it.
(Bonus question) The admin panel is running in port5001 so we have [app.py](https://app.py) and [app2.py](https://app2.py) in one project. But in order to run it in parallel I used threading and that disabled
/r/flask
https://redd.it/iv0pl2
YouTube
Two Factor Authentication with Flask
In this video I demonstrate an example two factor authentication application using the Flask microframework. For details on the implementation, see my blog article: http://blog.miguelgrinberg.com/post/two-factor-authentication-with-flask.
The source code…
The source code…
Is there a program to help you document Python functions?
I just finished a Python project and now want to go back and document each function while it is still fresh in my head. Is there a program that will scan your code for functions that don't have a doc-string and then interactively ask you to:
* describe the function
* document each parameter
* document the return value
It would then create a doc-string for you that you could simply copy/paste into your code.
Thanks.
/r/Python
https://redd.it/iuoxt0
I just finished a Python project and now want to go back and document each function while it is still fresh in my head. Is there a program that will scan your code for functions that don't have a doc-string and then interactively ask you to:
* describe the function
* document each parameter
* document the return value
It would then create a doc-string for you that you could simply copy/paste into your code.
Thanks.
/r/Python
https://redd.it/iuoxt0
reddit
Is there a program to help you document Python functions?
I just finished a Python project and now want to go back and document each function while it is still fresh in my head. Is there a program that...
Django, Django + ajax, Django +r react, which is best for creating like and unlike or follow or unfollow button functionality?
I m learning Django and try to create a web app with like unlike button and follow unfollow button functionality. when I search about this function many options came. some tutorials did it with Django some did it with django+ajax and some did it with django+react. if it's done only with Django then why ajax and react is important. right now I don't want to learn ajax or react that's why I m asking this question. is it ok to create those functions with just Django n python? is it possible?
/r/django
https://redd.it/iv2kla
I m learning Django and try to create a web app with like unlike button and follow unfollow button functionality. when I search about this function many options came. some tutorials did it with Django some did it with django+ajax and some did it with django+react. if it's done only with Django then why ajax and react is important. right now I don't want to learn ajax or react that's why I m asking this question. is it ok to create those functions with just Django n python? is it possible?
/r/django
https://redd.it/iv2kla
reddit
Django, Django + ajax, Django +r react, which is best for creating...
I m learning Django and try to create a web app with like unlike button and follow unfollow button functionality. when I search about this...
GitHub Codespaces with Django.
Hi this is my first try at making a YouTube video. I was really nervous and reluctant to make one.
But I anyhow needed up making this one about GitHub Codespaces.
Please watch the video and give me feedback! I know (I have a very bad microphone.😅)
https://youtu.be/O9NASwWInQY
/r/djangolearning
https://redd.it/iuzrf2
Hi this is my first try at making a YouTube video. I was really nervous and reluctant to make one.
But I anyhow needed up making this one about GitHub Codespaces.
Please watch the video and give me feedback! I know (I have a very bad microphone.😅)
https://youtu.be/O9NASwWInQY
/r/djangolearning
https://redd.it/iuzrf2
YouTube
GitHub Codespaces | Hand on Overview
This is a hands on overview of the newest feature of GitHub, Codespaces. Codespaces allows you to move you entire development online, from your local computer. You can develop entirely in the cloud using Codespaces, an integrated development environment (IDE)…
Running local notebooks server-side when needed
https://blog.valohai.com/minihai
/r/IPython
https://redd.it/iv383r
https://blog.valohai.com/minihai
/r/IPython
https://redd.it/iv383r
Valohai
Introducing Minihai – Easiest way to run notebooks remotely.
Minihai is the easiest way to run notebooks remotely without leaving your local Jupyter. Now open-source and available!
Access PC notebook from mobile
I have a Jupyter notebook running on my PC. Is it possible to access the notebook from a mobile browser? Both the PC and the mobile device are in the same WiFi network.
/r/IPython
https://redd.it/iuzo1c
I have a Jupyter notebook running on my PC. Is it possible to access the notebook from a mobile browser? Both the PC and the mobile device are in the same WiFi network.
/r/IPython
https://redd.it/iuzo1c
reddit
Access PC notebook from mobile
I have a Jupyter notebook running on my PC. Is it possible to access the notebook from a mobile browser? Both the PC and the mobile device are in...
The Most Popular Programming Languages - 1965/2020
https://youtu.be/UNSoPa-XQN0
/r/django
https://redd.it/iv7ggr
https://youtu.be/UNSoPa-XQN0
/r/django
https://redd.it/iv7ggr
YouTube
The Most Popular Programming Languages - 1965/2020
In this video the most used programming languages from 1965 to 2020. The data are updated to the second quarter of 2020. In the second quarter of 2020 the most used programming languages are: Python, Javascript and Java. C#, PHP, C++ and others follow.
…
…
JoCrypt. Easy low level encryption framework.
So i made this project for school purposes, but i built on it in my free time, added sql compatibilty and all.
I aimed to make a complete basic algorithmic encryption tool, but ended up adding hashes and steganography.
https://github.com/JodisKripe/JoCrypt
This is the github link...
Also i made a repl so you can try it out. Some features are limited tho..
www.jocrypt.sidjo.repl.run
It has websocket issues sometimes but should run okay.
Please let me know about any suggestions.
Cheers,
JodisKripe.
/r/Python
https://redd.it/iv2u64
So i made this project for school purposes, but i built on it in my free time, added sql compatibilty and all.
I aimed to make a complete basic algorithmic encryption tool, but ended up adding hashes and steganography.
https://github.com/JodisKripe/JoCrypt
This is the github link...
Also i made a repl so you can try it out. Some features are limited tho..
www.jocrypt.sidjo.repl.run
It has websocket issues sometimes but should run okay.
Please let me know about any suggestions.
Cheers,
JodisKripe.
/r/Python
https://redd.it/iv2u64
GitHub
GitHub - JodisKripe/JoCrypt: Encryption Program
Encryption Program. Contribute to JodisKripe/JoCrypt development by creating an account on GitHub.
Neuraxle - a Clean Machine Learning Framework
https://www.neuraxle.org/
/r/Python
https://redd.it/iv8fwo
https://www.neuraxle.org/
/r/Python
https://redd.it/iv8fwo
reddit
Neuraxle - a Clean Machine Learning Framework
Posted in r/Python by u/GChe • 82 points and 6 comments
How to deploy a Django web application to Heroku - a comprehensive guide 📖
https://blog.ninte.dev/how-to-deploy-a-django-web-application-to-heroku-a-comprehensive-guide-ckf7wrexw01ih5gs1gh2g7a5z
/r/django
https://redd.it/iv7g2h
https://blog.ninte.dev/how-to-deploy-a-django-web-application-to-heroku-a-comprehensive-guide-ckf7wrexw01ih5gs1gh2g7a5z
/r/django
https://redd.it/iv7g2h
blog.ninte.dev
How to deploy a Django web application to Heroku - a comprehensive guide
The process of taking a project from a local machine to the internet is in many ways a magical one. Heroku is a platform-as-a-service solution that offers simple deployment options to developers. This article will present a step-by-step guide to depl...
Saturday megathread: Share your resources!
Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic?
Use this thread to chat about and share Python resources!
/r/Python
https://redd.it/ivhocx
Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic?
Use this thread to chat about and share Python resources!
/r/Python
https://redd.it/ivhocx
reddit
Saturday megathread: Share your resources!
Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic? Use this thread to chat about and...
I made my large flask project open source! CryptoCurrency based community with wallets.
This has been a nonstop project during covid. It was on gitea but moved it to github. Its made with Python flask/ flasksqlalchemy / postgres. I decided to work on the project with my wife after she got a reddit gold and realized it was worth nothing and complained it should be a bitcoin or crypto something. Then we found out it probably benefits tencent (China) the most. So work began to bring the coin back to the people.
#Github
https://github.com/tipvote
#url
www.tipvote.com
#contribute or advice
Looking for people who want to contribute or help out. Also offering advice if you need help with a crypto based service.
/r/flask
https://redd.it/iv9xcq
This has been a nonstop project during covid. It was on gitea but moved it to github. Its made with Python flask/ flasksqlalchemy / postgres. I decided to work on the project with my wife after she got a reddit gold and realized it was worth nothing and complained it should be a bitcoin or crypto something. Then we found out it probably benefits tencent (China) the most. So work began to bring the coin back to the people.
#Github
https://github.com/tipvote
#url
www.tipvote.com
#contribute or advice
Looking for people who want to contribute or help out. Also offering advice if you need help with a crypto based service.
/r/flask
https://redd.it/iv9xcq
GitHub
Tipvote
A Social Media Website. Tipvote has 9 repositories available. Follow their code on GitHub.
How to deploy Django project that has a function that could take an hour to run?
Context: I am pulling data from an api via a function in my views.py file. The API i’m pulling data from has rate limits that could mean this function and ultimately, the template to be displayed would take an hour and all the while the user would just see a blank page while the function competes.
Two questions;
1) Is there a best practice for implementing large/time-intensive python functions in django apps? E.g submit a request, have some backend process run the function in the background then immediately return a “process running” confirmation?
2) Is there a way to return status updates a django template while the function is running so the user can get feedback on it’s status? (e.g 10% complete...)?
/r/django
https://redd.it/ivjeh3
Context: I am pulling data from an api via a function in my views.py file. The API i’m pulling data from has rate limits that could mean this function and ultimately, the template to be displayed would take an hour and all the while the user would just see a blank page while the function competes.
Two questions;
1) Is there a best practice for implementing large/time-intensive python functions in django apps? E.g submit a request, have some backend process run the function in the background then immediately return a “process running” confirmation?
2) Is there a way to return status updates a django template while the function is running so the user can get feedback on it’s status? (e.g 10% complete...)?
/r/django
https://redd.it/ivjeh3
reddit
How to deploy Django project that has a function that could take...
Context: I am pulling data from an api via a function in my views.py file. The API i’m pulling data from has rate limits that could mean this...
Django Friday Tips: Inspecting ORM queries
https://blog.ovalerio.net/archives/2023
/r/django
https://redd.it/ivhht2
https://blog.ovalerio.net/archives/2023
/r/django
https://redd.it/ivhht2
reddit
Django Friday Tips: Inspecting ORM queries
Posted in r/django by u/d_ethos • 12 points and 1 comment
storing passwords
how long is the expected output for a password that was salted and hashed using pbkdf2 and sha256? also, is using pbkdf2 and sha256 enough? or should I be using something else? what is the industry standard for salting and hashing?
/r/django
https://redd.it/ivo085
how long is the expected output for a password that was salted and hashed using pbkdf2 and sha256? also, is using pbkdf2 and sha256 enough? or should I be using something else? what is the industry standard for salting and hashing?
/r/django
https://redd.it/ivo085
reddit
storing passwords
how long is the expected output for a password that was salted and hashed using pbkdf2 and sha256? also, is using pbkdf2 and sha256 enough? or...
DB design
I am working as an intern as a backend dev using django. Now my senior dev asked me to do "db design" for a module. I have default dbsqlite in django. Now, what does this db design means?? What I am supposed to do? I know I have to create models to make a table in database. Apart from that what is db design?? .Please explain in layman terms.
/r/djangolearning
https://redd.it/ivlbn7
I am working as an intern as a backend dev using django. Now my senior dev asked me to do "db design" for a module. I have default dbsqlite in django. Now, what does this db design means?? What I am supposed to do? I know I have to create models to make a table in database. Apart from that what is db design?? .Please explain in layman terms.
/r/djangolearning
https://redd.it/ivlbn7
reddit
DB design
I am working as an intern as a backend dev using django. Now my senior dev asked me to do "db design" for a module. I have default dbsqlite in...