slow backend
Hello folks,
I am a beginner programmer, I am trying to build a web application for my university project.
I have made a pipeline which is related to pharmacology studies.
I want to take user inputs from my website and use it in my pipeline to generate output.
To take user inputs i have made a form which takes in a list of diseases and a file and some other information.
My problem is that I am not able to use my pipeline code in flask app.
Actually my pipeline code takes few minutes of time to generate output which is saved in a file and will be given to user.
I have tried calling a function in flask app to integrate my pipeline code. But it is not working. The pipeline is generating output when used outside of the flask app but not when I integrate it in my app.
Any suggestions for this kind of problems?
Thankyou
/r/flask
https://redd.it/132ior4
Hello folks,
I am a beginner programmer, I am trying to build a web application for my university project.
I have made a pipeline which is related to pharmacology studies.
I want to take user inputs from my website and use it in my pipeline to generate output.
To take user inputs i have made a form which takes in a list of diseases and a file and some other information.
My problem is that I am not able to use my pipeline code in flask app.
Actually my pipeline code takes few minutes of time to generate output which is saved in a file and will be given to user.
I have tried calling a function in flask app to integrate my pipeline code. But it is not working. The pipeline is generating output when used outside of the flask app but not when I integrate it in my app.
Any suggestions for this kind of problems?
Thankyou
/r/flask
https://redd.it/132ior4
Reddit
r/flask on Reddit: slow backend
Posted by u/lit_pulkit - 2 votes and 2 comments
Github CI/CD + Django
I want deploy my project, whenever there is pull request created for main branch. This should deploy my code to some subdomain. So that I can share with my team members. Onces complete testing and changes, upon successful merge of this PR in need to clear the setup code from my server except the environment. Looking for resources so that I can do so!
Note: I know Jenkins and other CI/CD tools still just looking for DIY type resources.
/r/django
https://redd.it/132lox8
I want deploy my project, whenever there is pull request created for main branch. This should deploy my code to some subdomain. So that I can share with my team members. Onces complete testing and changes, upon successful merge of this PR in need to clear the setup code from my server except the environment. Looking for resources so that I can do so!
Note: I know Jenkins and other CI/CD tools still just looking for DIY type resources.
/r/django
https://redd.it/132lox8
Reddit
r/django on Reddit: Github CI/CD + Django
Posted by u/kevalrajpal - No votes and 4 comments
P GPT + Machine Learning program, to generate product descriptions from photo - free to access
​
https://reddit.com/link/132nr0x/video/qrnfjhoyeswa1/player
Right now mainly focused on clothes, but other modules still works good.
Public tests if you are interested you can test it for free:
https://scribe.devopsbay.com
/r/MachineLearning
https://redd.it/132nr0x
​
https://reddit.com/link/132nr0x/video/qrnfjhoyeswa1/player
Right now mainly focused on clothes, but other modules still works good.
Public tests if you are interested you can test it for free:
https://scribe.devopsbay.com
/r/MachineLearning
https://redd.it/132nr0x
Reddit
r/MachineLearning on Reddit: [P] GPT + Machine Learning program, to generate product descriptions from photo - free to access
Posted by u/Rammasaur - No votes and no comments
N LAION publishes an open letter to "protect open-source AI in Europe" with Schmidhuber and Hochreiter as signatories
https://laion.ai/notes/letter-to-the-eu-parliament/
/r/MachineLearning
https://redd.it/1323w68
https://laion.ai/notes/letter-to-the-eu-parliament/
/r/MachineLearning
https://redd.it/1323w68
laion.ai
A Call to Protect Open-Source AI in Europe | LAION
<p><strong>An Open Letter to the European Parliament: Protecting Open-Source AI for a Safe, Secure, and Sovereign Digital Future</strong></p>
<p>LAION, along...
<p>LAION, along...
Best way to send data to notebook from external program - socket?
Is it possible to send data to a Jupyter notebook from an external program and have it appear e.g. as variables accessible within the notebook that change live when the external program updates them?
At the moment I have to export data as a file and use code in the notebook to load it e.g. as CSV. The ideal would be if this can be done for both Python and Julia notebooks as I have some scripts with each language.
My idea is to perhaps open a socket within the notebook server that my external app can connect to, so I can send commands to update vars e.g. "x=1,2,3,... " , "y=3,6,8,4,...". I would like then variables x and y to automatically change in the notebook, and dependent calculations to be redone and plots automatically updated as a result.
/r/JupyterNotebooks
https://redd.it/132s7fz
Is it possible to send data to a Jupyter notebook from an external program and have it appear e.g. as variables accessible within the notebook that change live when the external program updates them?
At the moment I have to export data as a file and use code in the notebook to load it e.g. as CSV. The ideal would be if this can be done for both Python and Julia notebooks as I have some scripts with each language.
My idea is to perhaps open a socket within the notebook server that my external app can connect to, so I can send commands to update vars e.g. "x=1,2,3,... " , "y=3,6,8,4,...". I would like then variables x and y to automatically change in the notebook, and dependent calculations to be redone and plots automatically updated as a result.
/r/JupyterNotebooks
https://redd.it/132s7fz
Reddit
r/JupyterNotebooks on Reddit: Best way to send data to notebook from external program - socket?
Posted by u/JemmaTrans2022 - No votes and no comments
Saturday Daily Thread: Resource Request and Sharing! Daily Thread
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/132duia
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/132duia
Reddit
r/Python on Reddit: Saturday Daily Thread: Resource Request and Sharing! Daily Thread
Posted by u/Im__Joseph - 1 vote and 4 comments
I tried to make automated YouTube videos using python
Hi everyone, We at Codingbridge tried to use AI to deliver Tech News Everyday, Here is how we did it
1) Use python and selenium to scrape tech related news
2) Preprocess textual data and add additional script
3) Create your own avatar using DeepFake .
4) Use text to speech model to convert textual data to wav format
5) Use MoviePy to cut the video in parts
6) Use Transformer Model to lip sync Video and Audio
7) Use MoviePy to add transitions and merge them in a single video file
8) Use Text to Image for Thumbnail
Here is the result please give your feedback
https://youtu.be/-sxZ2am4nRY
/r/Python
https://redd.it/132ichv
Hi everyone, We at Codingbridge tried to use AI to deliver Tech News Everyday, Here is how we did it
1) Use python and selenium to scrape tech related news
2) Preprocess textual data and add additional script
3) Create your own avatar using DeepFake .
4) Use text to speech model to convert textual data to wav format
5) Use MoviePy to cut the video in parts
6) Use Transformer Model to lip sync Video and Audio
7) Use MoviePy to add transitions and merge them in a single video file
8) Use Text to Image for Thumbnail
Here is the result please give your feedback
https://youtu.be/-sxZ2am4nRY
/r/Python
https://redd.it/132ichv
YouTube
The Automated Anchors Now in English!! Uttar Pradesh Site Hacked!! | Samsung Flip Phone |
Welcome back to The Automated Anchors, where we bring you the latest news and headlines of tech world with the power of artificial intelligence.
The Thumbnail, you saw, The Speech you hear, The face and the lip sync is made by python and various other models…
The Thumbnail, you saw, The Speech you hear, The face and the lip sync is made by python and various other models…
Full-length tutorial on adding automated CI (continuous integration) to your Python projects with GitHub Actions
https://www.youtube.com/watch?v=x3hkXbOkfM8&list=PLbn3jWIXv_ibMS6CFOKMZkOHimDB9xdU2&index=1
/r/Python
https://redd.it/132tpyi
https://www.youtube.com/watch?v=x3hkXbOkfM8&list=PLbn3jWIXv_ibMS6CFOKMZkOHimDB9xdU2&index=1
/r/Python
https://redd.it/132tpyi
YouTube
Continuous Integration with GitHub Actions and Python - Part 1: Linting
Please consider supporting me on Patreon: https://www.patreon.com/programmingwithalex
GitHub Action pylinters: https://github.com/marketplace/actions/pylinter
GitHub test_repo: https://github.com/programmingwithalex/test_repo_pylinter_v1
00:00 - Introduction…
GitHub Action pylinters: https://github.com/marketplace/actions/pylinter
GitHub test_repo: https://github.com/programmingwithalex/test_repo_pylinter_v1
00:00 - Introduction…
What's up in the Python community? - April 2023
https://bitecode.substack.com/p/whats-up-in-the-python-community
/r/Python
https://redd.it/132r0th
https://bitecode.substack.com/p/whats-up-in-the-python-community
/r/Python
https://redd.it/132r0th
www.bitecode.dev
What's up in the Python community?
April 2023
Introducing surveydown - an open source, markdown-based survey framework (that doesn’t exist yet)
Hi folks, I am developing a markdown-based survey platform, and before I go further in the dev work I wanted to carefully think about frameworks and goals, so I laid out my thoughts of the goals and features for this package in this blog post:
https://www.jhelvy.com/posts/2023-04-06-markdown-surveys/
I have a working prototype using Shiny (I am more experienced in R than Python), and I've put it up here: https://github.com/jhelvy/surveydown
But the more I tinker, the more I'm starting to thing that Python may be the better language for this given the many well-developed Python web frameworks out there. Here are some important desired features:
1. Ability to run code: This is perhaps the most important feature. A critical reason I want to build this is so that a user could use code to define aspects of their survey, e.g. randomizing information shown in questions, etc. I haven't seen a survey framework that allows users to run code inside the survey.
2. Markdown-based user interface: A user should be able to quickly define their survey using mostly plain markdown. Then they should be able to run a single command to compile those files into a live web-based survey.
3. Built-in database: Once the survey is compiled, it should
/r/Python
https://redd.it/1332tsx
Hi folks, I am developing a markdown-based survey platform, and before I go further in the dev work I wanted to carefully think about frameworks and goals, so I laid out my thoughts of the goals and features for this package in this blog post:
https://www.jhelvy.com/posts/2023-04-06-markdown-surveys/
I have a working prototype using Shiny (I am more experienced in R than Python), and I've put it up here: https://github.com/jhelvy/surveydown
But the more I tinker, the more I'm starting to thing that Python may be the better language for this given the many well-developed Python web frameworks out there. Here are some important desired features:
1. Ability to run code: This is perhaps the most important feature. A critical reason I want to build this is so that a user could use code to define aspects of their survey, e.g. randomizing information shown in questions, etc. I haven't seen a survey framework that allows users to run code inside the survey.
2. Markdown-based user interface: A user should be able to quickly define their survey using mostly plain markdown. Then they should be able to run a single command to compile those files into a live web-based survey.
3. Built-in database: Once the survey is compiled, it should
/r/Python
https://redd.it/1332tsx
jhelvy.com
jhelvy.com: {surveydown}: An open source, markdown-based survey framework (that doesn't exist yet)
Let's build this, who's with me?
Full-length tutorial on adding automated CI (continuous integration) to your Python projects with GitHub Actions
https://www.youtube.com/watch?v=x3hkXbOkfM8&list=PLbn3jWIXv_ibMS6CFOKMZkOHimDB9xdU2&index=1
/r/flask
https://redd.it/132tpz6
https://www.youtube.com/watch?v=x3hkXbOkfM8&list=PLbn3jWIXv_ibMS6CFOKMZkOHimDB9xdU2&index=1
/r/flask
https://redd.it/132tpz6
YouTube
Continuous Integration with GitHub Actions and Python - Part 1: Linting
Please consider supporting me on Patreon: https://www.patreon.com/programmingwithalex
GitHub Action pylinters: https://github.com/marketplace/actions/pylinter
GitHub test_repo: https://github.com/programmingwithalex/test_repo_pylinter_v1
00:00 - Introduction…
GitHub Action pylinters: https://github.com/marketplace/actions/pylinter
GitHub test_repo: https://github.com/programmingwithalex/test_repo_pylinter_v1
00:00 - Introduction…
You can't use pip on Ubuntu 23.04 anymore
so long story short you won't be able to run pip install x anymore. The reason why the command doesn’t work in Ubuntu 23.04 is because of an intentional shift in policy to avoid conflicts between the Python package manager(pip) and Ubuntu’s underlying APT. You can now only use pip by creating a virtual environment with venv. My question is, is this a good thing or a bad thing? is it a good move from Ubuntu's team or not? being able to use pip only from a virtual environment. idk what do you guys think about the whole thing?
/r/Python
https://redd.it/1338oge
so long story short you won't be able to run pip install x anymore. The reason why the command doesn’t work in Ubuntu 23.04 is because of an intentional shift in policy to avoid conflicts between the Python package manager(pip) and Ubuntu’s underlying APT. You can now only use pip by creating a virtual environment with venv. My question is, is this a good thing or a bad thing? is it a good move from Ubuntu's team or not? being able to use pip only from a virtual environment. idk what do you guys think about the whole thing?
/r/Python
https://redd.it/1338oge
Reddit
r/Python on Reddit: You can't use pip on Ubuntu 23.04 anymore
Posted by u/saleham5 - No votes and 20 comments
Case insensitive username with djangos built user creation?
I noticed when I create a dummy user with capitals and then I got to log in with all lower. it says user doesnt exist.
How can I default username to lower case? I am using Widget_Tweaks to style the form.
Here is my forms.py
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django import forms
class RegisterForm(UserCreationForm):
email = forms.EmailField(label='', widget=forms.TextInput(attrs={'class:':'form-control', 'placerholder':'Email Address'}))
firstname = forms.CharField(label='', widget=forms.TextInput(attrs={'class:':'form-control', 'placerholder':' First Name'}))
lastname = forms.CharField(label='', widget=forms.TextInput(attrs={'class:':'form-control', 'placerholder':'Last Name'}))
class Meta:
model = User
fields = ('username', 'firstname', 'lastname', 'email', 'password1', 'password2')
def init(self, args, kwargs):
super(RegisterForm, self).__init__(args, kwargs)
/r/djangolearning
https://redd.it/1339yi2
I noticed when I create a dummy user with capitals and then I got to log in with all lower. it says user doesnt exist.
How can I default username to lower case? I am using Widget_Tweaks to style the form.
Here is my forms.py
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django import forms
class RegisterForm(UserCreationForm):
email = forms.EmailField(label='', widget=forms.TextInput(attrs={'class:':'form-control', 'placerholder':'Email Address'}))
firstname = forms.CharField(label='', widget=forms.TextInput(attrs={'class:':'form-control', 'placerholder':' First Name'}))
lastname = forms.CharField(label='', widget=forms.TextInput(attrs={'class:':'form-control', 'placerholder':'Last Name'}))
class Meta:
model = User
fields = ('username', 'firstname', 'lastname', 'email', 'password1', 'password2')
def init(self, args, kwargs):
super(RegisterForm, self).__init__(args, kwargs)
/r/djangolearning
https://redd.it/1339yi2
Reddit
r/djangolearning on Reddit: Case insensitive username with djangos built user creation?
Posted by u/HeadlineINeed - No votes and 1 comment
Sunday Daily Thread: What's everyone working on this week?
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/133amkc
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/133amkc
Reddit
r/Python on Reddit: Sunday Daily Thread: What's everyone working on this week?
Posted by u/Im__Joseph - No votes and 2 comments
Use database or Pandas for a data that won't be manipulated
So I got some data which I need to fetch for operation in my Django process. It's currently stored in a Google sheet, and since there's multiple sheets Pandas can clean the data by passing the sheet link everytime it is asked for.
I can use a database, but would involve multiple steps to convert it into CSV and then download it and then import it to models
So which option is the more efficient way here?
/r/django
https://redd.it/133bmml
So I got some data which I need to fetch for operation in my Django process. It's currently stored in a Google sheet, and since there's multiple sheets Pandas can clean the data by passing the sheet link everytime it is asked for.
I can use a database, but would involve multiple steps to convert it into CSV and then download it and then import it to models
So which option is the more efficient way here?
/r/django
https://redd.it/133bmml
Reddit
r/django on Reddit: Use database or Pandas for a data that won't be manipulated
Posted by u/LeaveMoist - No votes and 3 comments
Tutorial: Deploy a Django application to AWS Lightsail with Docker and GitHub Actions
https://youtu.be/-6tAWlYFAx0
/r/django
https://redd.it/1333gwo
https://youtu.be/-6tAWlYFAx0
/r/django
https://redd.it/1333gwo
YouTube
Tutorial: Deploy a Django application to AWS Lightsail with Docker and GitHub Actions
I got a lot of questions on my workflow on Reddit. As a result I decided to capture my screen and walk you through my GitHub Action workflow runs. It's fairly DIY but great for solo projects.
I also found that some people avoid Lightsail because they think…
I also found that some people avoid Lightsail because they think…
Trying to deploy Flask app to render.com
Hi there! Flask newbie here.
I am trying to deploy a simple Flask app (just a hello world route for now) to render.com. I know that I'll need PyAudio for this project. So I already included it in the dependencies. Now when I deploy to render.com I get the following error message:
If I understand it correctly portaudio is a C library that is needed by PyAudio. Which means I have to rely on portaudio being installed on the system I want to deploy to? Or alternatively use Docker (very limited knowledge)?
Any pointers into the right direction would be much appreciated!
EDIT:
Another thing that really confuses me is that, when I a generate a requirements.txt it adds
ERROR: Could not find a version that satisfies the requirement Flask==2.3.1 (from -r requirements.txt (line 9)) (from versions: 0.1, 0.2, 0.3, 0.3.1, 0.4, 0.5, 0.5.1, 0.5.2, 0.6, 0.6.1, 0.7, 0.7.1, 0.7.2, 0.8, 0.8.1, 0.9, 0.10, 0.10.1, 0.11, 0.11.1, 0.12, 0.12.1, 0.12.2, 0.12.3, 0.12.4, 0.12.5, 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1,
/r/flask
https://redd.it/132q7s1
Hi there! Flask newbie here.
I am trying to deploy a simple Flask app (just a hello world route for now) to render.com. I know that I'll need PyAudio for this project. So I already included it in the dependencies. Now when I deploy to render.com I get the following error message:
src/pyaudio/device_api.c:9:10: fatal error: portaudio.h: No such file or directoryIf I understand it correctly portaudio is a C library that is needed by PyAudio. Which means I have to rely on portaudio being installed on the system I want to deploy to? Or alternatively use Docker (very limited knowledge)?
Any pointers into the right direction would be much appreciated!
EDIT:
Another thing that really confuses me is that, when I a generate a requirements.txt it adds
Flask==2.3.1 as a dependency, which is current version. But the in the render.com logs I get ERROR: Could not find a version that satisfies the requirement Flask==2.3.1 (from -r requirements.txt (line 9)) (from versions: 0.1, 0.2, 0.3, 0.3.1, 0.4, 0.5, 0.5.1, 0.5.2, 0.6, 0.6.1, 0.7, 0.7.1, 0.7.2, 0.8, 0.8.1, 0.9, 0.10, 0.10.1, 0.11, 0.11.1, 0.12, 0.12.1, 0.12.2, 0.12.3, 0.12.4, 0.12.5, 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1,
/r/flask
https://redd.it/132q7s1
Render
Cloud Application Platform | Render
On Render, you can build, deploy, and scale your apps with unparalleled ease – from your first user to your billionth.
Flask API - CSRF and JWT implementation with frontend
Hello,
I am creating an SPA using Flask for the API endpoints. I want to secure the app using CSRF tokens and JWT tokens to prevent all types of XSS and CSRF attacks.
The front end is Vue. I am using axios to perform the requests.
I am a bit lost on how to do this implementation. When should the CSRF token be sent and how will it be stored on the frontend? What about the JWT and how to implement it with the csrf ? Too many questions and I can't seem to find anything complete online.
Does anyone have any implementation examples or knows how to do it correctly? I would appreciate any help on this matter.
Thank you.
/r/flask
https://redd.it/131nljo
Hello,
I am creating an SPA using Flask for the API endpoints. I want to secure the app using CSRF tokens and JWT tokens to prevent all types of XSS and CSRF attacks.
The front end is Vue. I am using axios to perform the requests.
I am a bit lost on how to do this implementation. When should the CSRF token be sent and how will it be stored on the frontend? What about the JWT and how to implement it with the csrf ? Too many questions and I can't seem to find anything complete online.
Does anyone have any implementation examples or knows how to do it correctly? I would appreciate any help on this matter.
Thank you.
/r/flask
https://redd.it/131nljo
Reddit
r/flask on Reddit: Flask API - CSRF and JWT implementation with frontend
Posted by u/jeanelk - 5 votes and 3 comments
I have a username_or_email_form is there any way to query flask-sqlalchemy query for username or email at the same query?
I could query both separately but it would make my life easier if I could query 2 possible columns and return 1 query.
​
/r/flask
https://redd.it/1326agw
I could query both separately but it would make my life easier if I could query 2 possible columns and return 1 query.
​
/r/flask
https://redd.it/1326agw
Reddit
r/flask on Reddit: I have a username_or_email_form is there any way to query flask-sqlalchemy query for username or email at the…
Posted by u/notprimenumber12344 - 1 vote and 6 comments
Media is too big
VIEW IN TELEGRAM
[R] Video of experiments from DeepMind's recent “Learning Agile Soccer Skills for a Bipedal Robot with Deep Reinforcement Learning” (OP3 Soccer) project
https://redd.it/132w40c
@pythondaily
https://redd.it/132w40c
@pythondaily