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
newbie question - df.method() vs method(df)
Hi All,
I'm not new to stats, but I am new to python. Something I'm struggling with is when to use the syntax df.method() versus the syntax method(df).
For example, I see I can get the length of a dataframe with len(df) but not df.len() . I'm sure there's a reason, but I haven't come across it yet! In contrast, I can see the first five lines of a dataframe with df.head() but not head(df) .
What am I missing? I'm using Codecademy, and they totally glossed over this. I've searched for similar posts and didn't see any.
Thanks for your help!
/r/pystats
https://redd.it/1340jbx
Hi All,
I'm not new to stats, but I am new to python. Something I'm struggling with is when to use the syntax df.method() versus the syntax method(df).
For example, I see I can get the length of a dataframe with len(df) but not df.len() . I'm sure there's a reason, but I haven't come across it yet! In contrast, I can see the first five lines of a dataframe with df.head() but not head(df) .
What am I missing? I'm using Codecademy, and they totally glossed over this. I've searched for similar posts and didn't see any.
Thanks for your help!
/r/pystats
https://redd.it/1340jbx
Reddit
r/pystats on Reddit: newbie question - df.method() vs method(df)
Posted by u/TeacherShae - 1 vote and 6 comments
Flask app rendering only base page without extending/dynamic content in all cases.
Please bear with me as I'm a complete beginner in Web Development and recently started Flask.
I have the following code for the app:
@app.route('/', methods='POST','GET')
def index():
if request.method == 'POST':
{stuff}
try:
{stuff}
except youtubetranscriptapi.errors.TranscriptsDisabled:
return rendertemplate('index.html', urlfieldtext="Wrong URL")
{stuff}
return rendertemplate('index success.html')
else:
return rendertemplate('index.html', urlfieldtext="Enter Video url")
The relevant code for index.html page:
<form action="/" method="post" id="details-form">
/r/flask
https://redd.it/133uonp
Please bear with me as I'm a complete beginner in Web Development and recently started Flask.
I have the following code for the app:
@app.route('/', methods='POST','GET')
def index():
if request.method == 'POST':
{stuff}
try:
{stuff}
except youtubetranscriptapi.errors.TranscriptsDisabled:
return rendertemplate('index.html', urlfieldtext="Wrong URL")
{stuff}
return rendertemplate('index success.html')
else:
return rendertemplate('index.html', urlfieldtext="Enter Video url")
The relevant code for index.html page:
<form action="/" method="post" id="details-form">
/r/flask
https://redd.it/133uonp
Reddit
r/flask on Reddit: Flask app rendering only base page without extending/dynamic content in all cases.
Posted by u/_Despaired_ - No votes and 10 comments
Api vs Django views
Hey guys I’m a beginner in Django and I’m wondering is DRF api development an alternative to using default django views or are they completely different concepts? If they are different, when do I use DRF exactly?
/r/django
https://redd.it/1343dh5
Hey guys I’m a beginner in Django and I’m wondering is DRF api development an alternative to using default django views or are they completely different concepts? If they are different, when do I use DRF exactly?
/r/django
https://redd.it/1343dh5
Reddit
r/django on Reddit: Api vs Django views
Posted by u/thepragprog - 2 votes and 2 comments
Monday Daily Thread: Project ideas!
Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code! If you're looking for project ideas, you might be interested in checking out Al Sweigart's, "The Big Book of Small Python Projects" which provides a list of projects and the code to make them work.
/r/Python
https://redd.it/13472vn
Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code! If you're looking for project ideas, you might be interested in checking out Al Sweigart's, "The Big Book of Small Python Projects" which provides a list of projects and the code to make them work.
/r/Python
https://redd.it/13472vn
Reddit
r/Python on Reddit: Monday Daily Thread: Project ideas!
Posted by u/Im__Joseph - 4 votes and no comments