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
Running Python micro-benchmarks using the ChatGPT Code Interpreter alpha
https://simonwillison.net/2023/Apr/12/code-interpreter/
/r/Python
https://redd.it/133k4jk
https://simonwillison.net/2023/Apr/12/code-interpreter/
/r/Python
https://redd.it/133k4jk
simonwillison.net
Running Python micro-benchmarks using the ChatGPT Code Interpreter alpha
Today I wanted to understand the performance difference between two Python implementations of a mechanism to detect changes to a SQLite database schema. I rendered the difference between the two …
This media is not supported in your browser
VIEW IN TELEGRAM
I made a Python package to do adaptive learning of functions in parallel [P]
https://redd.it/133ew06
@pythondaily
https://redd.it/133ew06
@pythondaily
TemplateDoesNotExist: bootstrap4/uni_form.html
how to solve this, im getting this error while usng {{form|crisp}}. i've successfully intalled django-crispy-forms and added to the installed app and also used to bootstrap4 for crispytemplate. help me out guys
/r/django
https://redd.it/133s4j9
how to solve this, im getting this error while usng {{form|crisp}}. i've successfully intalled django-crispy-forms and added to the installed app and also used to bootstrap4 for crispytemplate. help me out guys
/r/django
https://redd.it/133s4j9
Reddit
r/django on Reddit: TemplateDoesNotExist: bootstrap4/uni_form.html
Posted by u/Longjumping-Class420 - No votes and no comments
How to validate the fields in the json body in DRF?
I'm using in my project Django and DRF. I'm trying to validate the json body of the request data is the exact that I'm expecting:
correct json:
{
"name": "john"
}
incorrect json
{
"name": "john"
"lastname": "doe"
}
If I send the second one (incorrect) is still working and creating objects in the DB.
I want to avoid this behavoir.
/r/djangolearning
https://redd.it/1338z05
I'm using in my project Django and DRF. I'm trying to validate the json body of the request data is the exact that I'm expecting:
correct json:
{
"name": "john"
}
incorrect json
{
"name": "john"
"lastname": "doe"
}
If I send the second one (incorrect) is still working and creating objects in the DB.
I want to avoid this behavoir.
/r/djangolearning
https://redd.it/1338z05
Reddit
r/djangolearning on Reddit: How to validate the fields in the json body in DRF?
Posted by u/PxfW4882ke1c4051_h_3 - 4 votes and 8 comments
Flask app with Javascript front end
I am getting status code of 200 on the server side but status code of 405 on the client side. Looking for some help here. I know that 405 means the method isnt supported but as you see in the flask app it is supported. Any help would be appreciated.
Here is my flask app:
from flask import Flask, request, jsonify
import os
app = Flask(__name__)
@app.route('/upload', methods=['POST', 'GET'])
def upload_files():
uploaded_files = request.files.getlist('files')
date = request.form.get('date')
for file in uploaded_files:
# Save the uploaded file to a folder on your server
print(file.filename)
save_path = os.path.join(os.getcwd(), file.filename)
file.save(save_path)
/r/flask
https://redd.it/133yz6u
I am getting status code of 200 on the server side but status code of 405 on the client side. Looking for some help here. I know that 405 means the method isnt supported but as you see in the flask app it is supported. Any help would be appreciated.
Here is my flask app:
from flask import Flask, request, jsonify
import os
app = Flask(__name__)
@app.route('/upload', methods=['POST', 'GET'])
def upload_files():
uploaded_files = request.files.getlist('files')
date = request.form.get('date')
for file in uploaded_files:
# Save the uploaded file to a folder on your server
print(file.filename)
save_path = os.path.join(os.getcwd(), file.filename)
file.save(save_path)
/r/flask
https://redd.it/133yz6u
Reddit
r/flask on Reddit: Flask app with Javascript front end
Posted by u/Whatupcraig - No votes and no comments
Frogmouth - A Markdown browser for your terminal
https://github.com/Textualize/frogmouth
/r/Python
https://redd.it/133par1
https://github.com/Textualize/frogmouth
/r/Python
https://redd.it/133par1
GitHub
GitHub - Textualize/frogmouth: A Markdown browser for your terminal
A Markdown browser for your terminal. Contribute to Textualize/frogmouth development by creating an account on GitHub.
Good Course or Book for Design Quality Frontend for Fullstack Django Developer
Any recommended course or books to design quality web pages? As a Fullstack developer, I struggle with design quality front end as a fullstack developer. Best practices that I learned so far are in bits and pieces. My friend and I are building a product but neither of us have UX design experience.
/r/django
https://redd.it/133uz3i
Any recommended course or books to design quality web pages? As a Fullstack developer, I struggle with design quality front end as a fullstack developer. Best practices that I learned so far are in bits and pieces. My friend and I are building a product but neither of us have UX design experience.
/r/django
https://redd.it/133uz3i
Reddit
r/django on Reddit: Good Course or Book for Design Quality Frontend for Fullstack Django Developer
Posted by u/OneLastPie - 10 votes and 7 comments