h5 file machine learning, flask to kivy
Hi there!
I’m currently developing a Kivy app for sign language detection, and I’ve already trained a model using TensorFlow. I’m interested in using Flask to handle model predictions and integrating Flask with my Kivy app. Is it feasible to set up Flask in this way, and if so, what are the steps involved? Specifically, I need guidance on how to set up Flask to serve the model, connect the Kivy app to this Flask server, and ensure smooth communication between the two components.
Thanks in advance for your help!
Initially, I set up a Flask server and realized that both the Flask server and the Kivy app need to run simultaneously. To manage this, I created them as separate projects. However, I’ve encountered a couple of issues:
The Kivy app either takes a long time to load or doesn't load at all, displaying only a black screen. I’m also receiving an error when I try to run the Flask server script.
I can't add image but the error is
RecursionError: maximum recursion depth exceeded
/r/flask
https://redd.it/1f2kybc
Hi there!
I’m currently developing a Kivy app for sign language detection, and I’ve already trained a model using TensorFlow. I’m interested in using Flask to handle model predictions and integrating Flask with my Kivy app. Is it feasible to set up Flask in this way, and if so, what are the steps involved? Specifically, I need guidance on how to set up Flask to serve the model, connect the Kivy app to this Flask server, and ensure smooth communication between the two components.
Thanks in advance for your help!
Initially, I set up a Flask server and realized that both the Flask server and the Kivy app need to run simultaneously. To manage this, I created them as separate projects. However, I’ve encountered a couple of issues:
The Kivy app either takes a long time to load or doesn't load at all, displaying only a black screen. I’m also receiving an error when I try to run the Flask server script.
I can't add image but the error is
RecursionError: maximum recursion depth exceeded
/r/flask
https://redd.it/1f2kybc
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Vectorlite v0.2.0 released: Fast, SQL powered, in-process vector search for any language with an SQL
Hi reddit, I write a sqlite extension for fast vector search. 1yefuwang1/vectorlite: Fast vector search for SQLite (github.com).
I'm pleased to announce the v0.2.0 release News — vectorlite 0.2.0 documentation (1yefuwang1.github.io)
It is pre-compiled and distributed as python wheels and can be installed using pip.
# What My Project Does
Vectorlite enables fast, SQL powered, in-process vector search with first class Python support.
# Some highlights for v0.2.0
Vectorlite is fast since its first release, mainly thanks to the underlying vector search library hnswlib. However, hnswlib comes with some limitations:
1. hnswlib’s vector distance implementation falls back to a slow scalar implementation on ARM platforms.
2. On x64 platforms with AVX2 support, hnswlib’s SIMD implementation only uses AVX instructions when faster instructions like Fused-Multiply-Add are available.
3. SIMD instructions are determined at compile time. It could be problematic because vectorlite is currently distributed as pre-compiled packages against AVX2 for python and nodejs, but a user’s machine may not support it. Besides, if a user’s machine supports more advacned SIMD instructions like AVX-512, pre-compiled vectorlite won’t be able to leverage them.
4. hnswlib’s vector normalization, which is requried when using cosine distance, is not SIMD accelerated.
Vectorlite addresses theses issues in v0.2.0 release by implementing its own portable vector distance implementation using Google’s highway library.
As
/r/Python
https://redd.it/1f2bidf
Hi reddit, I write a sqlite extension for fast vector search. 1yefuwang1/vectorlite: Fast vector search for SQLite (github.com).
I'm pleased to announce the v0.2.0 release News — vectorlite 0.2.0 documentation (1yefuwang1.github.io)
It is pre-compiled and distributed as python wheels and can be installed using pip.
pip install vectorlite-py# What My Project Does
Vectorlite enables fast, SQL powered, in-process vector search with first class Python support.
# Some highlights for v0.2.0
Vectorlite is fast since its first release, mainly thanks to the underlying vector search library hnswlib. However, hnswlib comes with some limitations:
1. hnswlib’s vector distance implementation falls back to a slow scalar implementation on ARM platforms.
2. On x64 platforms with AVX2 support, hnswlib’s SIMD implementation only uses AVX instructions when faster instructions like Fused-Multiply-Add are available.
3. SIMD instructions are determined at compile time. It could be problematic because vectorlite is currently distributed as pre-compiled packages against AVX2 for python and nodejs, but a user’s machine may not support it. Besides, if a user’s machine supports more advacned SIMD instructions like AVX-512, pre-compiled vectorlite won’t be able to leverage them.
4. hnswlib’s vector normalization, which is requried when using cosine distance, is not SIMD accelerated.
Vectorlite addresses theses issues in v0.2.0 release by implementing its own portable vector distance implementation using Google’s highway library.
As
/r/Python
https://redd.it/1f2bidf
GitHub
GitHub - 1yefuwang1/vectorlite: Fast, SQL powered, in-process vector search for any language with an SQLite driver
Fast, SQL powered, in-process vector search for any language with an SQLite driver - 1yefuwang1/vectorlite
Slowstore - Live JSON Store for your objects
https://github.com/42dotmk/slowstore
# What Slowstore does
slowstore is simple to use, single file, key-value store that stores your objects as JSON files in a live fashion (by default).
It is designed to be easy to plug into your program, without the need of server, connection strings, nothing, just provide the directory where you like to store your files.
There are multiple projects that store objects on file system, but they mostly behave like regular dbs and mainly use pickled object. This library has an intent of the data to be easy readable and to be treated just as a dictionary.
## Comparison
Simple, consider it like a dictionary that auto stores changes on disk, and you can further inspect these changes.
# Not Production Ready
Slowstore is slow and it is intended to be used for exploration.
/r/Python
https://redd.it/1f2lf7n
https://github.com/42dotmk/slowstore
# What Slowstore does
slowstore is simple to use, single file, key-value store that stores your objects as JSON files in a live fashion (by default).
It is designed to be easy to plug into your program, without the need of server, connection strings, nothing, just provide the directory where you like to store your files.
There are multiple projects that store objects on file system, but they mostly behave like regular dbs and mainly use pickled object. This library has an intent of the data to be easy readable and to be treated just as a dictionary.
## Comparison
Simple, consider it like a dictionary that auto stores changes on disk, and you can further inspect these changes.
# Not Production Ready
Slowstore is slow and it is intended to be used for exploration.
/r/Python
https://redd.it/1f2lf7n
GitHub
GitHub - 42dotmk/slowstore
Contribute to 42dotmk/slowstore development by creating an account on GitHub.
Wednesday Daily Thread: Beginner questions
# Weekly Thread: Beginner Questions 🐍
Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.
## How it Works:
1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.
## Guidelines:
This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).
## Recommended Resources:
If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.
## Example Questions:
1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?
Let's help each other learn Python! 🌟
/r/Python
https://redd.it/1f2w8b8
# Weekly Thread: Beginner Questions 🐍
Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.
## How it Works:
1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.
## Guidelines:
This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).
## Recommended Resources:
If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.
## Example Questions:
1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?
Let's help each other learn Python! 🌟
/r/Python
https://redd.it/1f2w8b8
Discord
Join the Python Discord Server!
We're a large community focused around the Python programming language. We believe that anyone can learn to code. | 412982 members
Dynamic filtering
https://youtu.be/L6SSwgURQCA?si=JOxIWgrE_FUINZlt
/r/djangolearning
https://redd.it/1f2sord
https://youtu.be/L6SSwgURQCA?si=JOxIWgrE_FUINZlt
/r/djangolearning
https://redd.it/1f2sord
YouTube
Master Dynamic Filtering in Django REST Framework with django-filter
🚀 **Transform Your Django APIs with Dynamic Filtering!** 🚀
In this quick reel, learn how to set up dynamic filters in Django REST Framework using `django-filter`. We cover:
1. Installing `django-filter`
2. Configuring your project
3. Creating and applying…
In this quick reel, learn how to set up dynamic filters in Django REST Framework using `django-filter`. We cover:
1. Installing `django-filter`
2. Configuring your project
3. Creating and applying…
Django project setup
Hello guys. I was wondering how a "professional" Django setup should be. I currently use the classical way through virtualenv and . requirements.txt. But I recently discovered pdm. It can also generate a template for Django projects. Is it a good idea? I also discovered poetry. What do you guys mostly use?
/r/django
https://redd.it/1f2lkl3
Hello guys. I was wondering how a "professional" Django setup should be. I currently use the classical way through virtualenv and . requirements.txt. But I recently discovered pdm. It can also generate a template for Django projects. Is it a good idea? I also discovered poetry. What do you guys mostly use?
/r/django
https://redd.it/1f2lkl3
Reddit
From the django community on Reddit
Explore this post and more from the django community
Showcase: Python AI Apps for Subtitles, Summarization, and Image Processing
Hello, Python community!
I’ve been learning about popular AI models and have created several Python apps leveraging them. I’d love to share my work and would greatly appreciate any feedback. Here’s a brief overview of each project:
# AutoSubs
What My Project Does:
AutoSubs is a web app that automatically generates subtitles for videos, allowing users to customize text styles, font types, sizes, and animation effects. The app also provides a quick manual review process to edit incorrect names or spellings.
Target Audience:
This tool is ideal for content creators, particularly those who produce YouTube Shorts or social media videos and need an efficient way to add subtitles.
Comparison:
Unlike other subtitle generators that offer limited styling options, AutoSubs emphasizes customization giving users greater control over the appearance of their subtitles.
# VideoSummarizer
What My Project Does:
VideoSummarizer is a web app designed to summarize YouTube videos. Users can input a YouTube URL and specify a word limit for the summary, which the app generates using natural language processing techniques.
Target Audience:
This tool is useful for anyone looking to quickly grasp the main points of a lengthy YouTube video, including students, researchers, and busy professionals.
Comparison:
While there are several video summarization
/r/Python
https://redd.it/1f2d7u9
Hello, Python community!
I’ve been learning about popular AI models and have created several Python apps leveraging them. I’d love to share my work and would greatly appreciate any feedback. Here’s a brief overview of each project:
# AutoSubs
What My Project Does:
AutoSubs is a web app that automatically generates subtitles for videos, allowing users to customize text styles, font types, sizes, and animation effects. The app also provides a quick manual review process to edit incorrect names or spellings.
Target Audience:
This tool is ideal for content creators, particularly those who produce YouTube Shorts or social media videos and need an efficient way to add subtitles.
Comparison:
Unlike other subtitle generators that offer limited styling options, AutoSubs emphasizes customization giving users greater control over the appearance of their subtitles.
# VideoSummarizer
What My Project Does:
VideoSummarizer is a web app designed to summarize YouTube videos. Users can input a YouTube URL and specify a word limit for the summary, which the app generates using natural language processing techniques.
Target Audience:
This tool is useful for anyone looking to quickly grasp the main points of a lengthy YouTube video, including students, researchers, and busy professionals.
Comparison:
While there are several video summarization
/r/Python
https://redd.it/1f2d7u9
GitHub
GitHub - prashkrans/auto_subs: A Gradio web application in Python for automatically generating and embedding subtitles in videos…
A Gradio web application in Python for automatically generating and embedding subtitles in videos, with customization options. - prashkrans/auto_subs
flask-files
from flask import Flask
def Moscow(stor,okk):
try:
if 'add' in stor:
idad=stor.split(':')1
with open('adm.txt','a') as ado:
ado.write(f'{idad}\n')
return {"Good":"add admin"}
elif 'delet' in stor:
idele = stor.split(':')1
fileo = open('adm.txt','r').read()
if str(fileo) in str(idele):
eo = fileo.replace(idele,"")
with open('adm.txt','w') as wor:
wor.write(idele)
else:
return {"No":"ID IN Files"}
elif 'ofer' in stor:
op = open('adm.txt','r').read()
return op
except:
return {"Error"}
app = Flask(name)
@app.route('/<num>/stor=<text>')
def main(text,num):
try:
return Moscow(text,int(num))
except:
return {"BAD"}
if name == "main":
app.run(host='0.0.0.0', port=81)
/r/flask
https://redd.it/1f2um6j
from flask import Flask
def Moscow(stor,okk):
try:
if 'add' in stor:
idad=stor.split(':')1
with open('adm.txt','a') as ado:
ado.write(f'{idad}\n')
return {"Good":"add admin"}
elif 'delet' in stor:
idele = stor.split(':')1
fileo = open('adm.txt','r').read()
if str(fileo) in str(idele):
eo = fileo.replace(idele,"")
with open('adm.txt','w') as wor:
wor.write(idele)
else:
return {"No":"ID IN Files"}
elif 'ofer' in stor:
op = open('adm.txt','r').read()
return op
except:
return {"Error"}
app = Flask(name)
@app.route('/<num>/stor=<text>')
def main(text,num):
try:
return Moscow(text,int(num))
except:
return {"BAD"}
if name == "main":
app.run(host='0.0.0.0', port=81)
/r/flask
https://redd.it/1f2um6j
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
How do you get users to login as bloggers?
So I'm a complete beginner and am making a blogging application as part of the mdn django tutorial. I know the django authentication basics, and have created a one-one relationship between a blogger model and users, but I have no idea how one restricts access to only those users with blogger models and allows users to register as bloggers.
/r/django
https://redd.it/1f2n9bc
So I'm a complete beginner and am making a blogging application as part of the mdn django tutorial. I know the django authentication basics, and have created a one-one relationship between a blogger model and users, but I have no idea how one restricts access to only those users with blogger models and allows users to register as bloggers.
/r/django
https://redd.it/1f2n9bc
Reddit
From the django community on Reddit
Explore this post and more from the django community
PyPy 7.3.17 is out, with python2.7 and 3.10
https://pypy.org/posts/2024/08/pypy-v7317-release.html
A new RISCV backend, an updated REPL, faster and more complient with CPython. Give it a try. Works best on pure python codebases. PyPy really shines for simulations or other tasks with lots of python loops.
/r/Python
https://redd.it/1f34sxy
https://pypy.org/posts/2024/08/pypy-v7317-release.html
A new RISCV backend, an updated REPL, faster and more complient with CPython. Give it a try. Works best on pure python codebases. PyPy really shines for simulations or other tasks with lots of python loops.
/r/Python
https://redd.it/1f34sxy
PyPy
PyPy v7.3.17 release
PyPy v7.3.17: release of python 2.7 and 3.10
The PyPy team is proud to release version 7.3.17 of PyPy.
This release includes a new RISC-V JIT backend, an improved REPL based on
work by the CPython tea
The PyPy team is proud to release version 7.3.17 of PyPy.
This release includes a new RISC-V JIT backend, an improved REPL based on
work by the CPython tea
Flask-SocketIO: "Invalid async_mode specified" Error with Threading
Hi everyone,
I'm working on a project that uses Flask-SocketIO, and I'm running into an issue when trying to use threading as the async mode. My setup is as follows:
* I'm using Flask for my backend with Flask-SocketIO for real-time communication.
* My app requires the use of threading for certain operations, so I'm specifying `async_mode='threading'` in my SocketIO initialization.
However, I'm getting the following error when I try to run my app:
Traceback (most recent call last):
File "app.py", line 23, in <module>
socketio = SocketIO(app, cors_allowed_origins="*", async_mode='threading')
File "flask_socketio/__init__.py", line 187, in __init__
File "flask_socketio/__init__.py", line 243, in init_app
File "socketio/base_server.py", line 31, in __init__
File "engineio/base_server.py", line 81, in __init__
ValueError: Invalid async_mode specified
[PYI-2526802:ERROR] Failed to execute script 'app' due to unhandled exception!
I've tried a few things, including removing and reinstalling dependencies, but the error persists. From my understanding, Flask-SocketIO should support threading as an async mode. What am I missing here? Has anyone encountered this issue before and
/r/flask
https://redd.it/1f3b2vu
Hi everyone,
I'm working on a project that uses Flask-SocketIO, and I'm running into an issue when trying to use threading as the async mode. My setup is as follows:
* I'm using Flask for my backend with Flask-SocketIO for real-time communication.
* My app requires the use of threading for certain operations, so I'm specifying `async_mode='threading'` in my SocketIO initialization.
However, I'm getting the following error when I try to run my app:
Traceback (most recent call last):
File "app.py", line 23, in <module>
socketio = SocketIO(app, cors_allowed_origins="*", async_mode='threading')
File "flask_socketio/__init__.py", line 187, in __init__
File "flask_socketio/__init__.py", line 243, in init_app
File "socketio/base_server.py", line 31, in __init__
File "engineio/base_server.py", line 81, in __init__
ValueError: Invalid async_mode specified
[PYI-2526802:ERROR] Failed to execute script 'app' due to unhandled exception!
I've tried a few things, including removing and reinstalling dependencies, but the error persists. From my understanding, Flask-SocketIO should support threading as an async mode. What am I missing here? Has anyone encountered this issue before and
/r/flask
https://redd.it/1f3b2vu
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Improved QLineEdit for PyQt and PySide
Hey,
I wanted the QLineEdit to have an animated placeholder text that moves between inside and outside position depending on widget focus and text, so the placeholder is visible at all times while having a clean and modern look. I couldn't find any library for it so I made one.
Preview: https://github.com/user-attachments/assets/267832aa-44a3-4532-aca9-7e3b393e8a4b
What My Project Does:
It keeps every feature from the original QLineEdit and improves the placeholder text by animating it between two positions (inside and outside position). If the widget is not in focus and there is no input text, the placeholder is in the original (inside) position. If the widget is focused or has input text, the placeholder text moves to the outside, creating a gap in the border. This way the placeholder text is visible at all times.
The project can be used with PyQt5, PyQt6, PySide2, and PySide6, is completely customizable and easy to use. You can change the animation's duration and easing curve, the font used for the placeholder text (+ different sizes and colors depending on the position) and much more.
Target Audience:
It can be useful for anyone working with PyQt or PySide who wants to use a clean, modern and easy to use QLineEdit.
Comparison:
I couldn't find any library
/r/Python
https://redd.it/1f374p3
Hey,
I wanted the QLineEdit to have an animated placeholder text that moves between inside and outside position depending on widget focus and text, so the placeholder is visible at all times while having a clean and modern look. I couldn't find any library for it so I made one.
Preview: https://github.com/user-attachments/assets/267832aa-44a3-4532-aca9-7e3b393e8a4b
What My Project Does:
It keeps every feature from the original QLineEdit and improves the placeholder text by animating it between two positions (inside and outside position). If the widget is not in focus and there is no input text, the placeholder is in the original (inside) position. If the widget is focused or has input text, the placeholder text moves to the outside, creating a gap in the border. This way the placeholder text is visible at all times.
The project can be used with PyQt5, PyQt6, PySide2, and PySide6, is completely customizable and easy to use. You can change the animation's duration and easing curve, the font used for the placeholder text (+ different sizes and colors depending on the position) and much more.
Target Audience:
It can be useful for anyone working with PyQt or PySide who wants to use a clean, modern and easy to use QLineEdit.
Comparison:
I couldn't find any library
/r/Python
https://redd.it/1f374p3
How can I start freelancing as a Django developer?
I have work on couple of Django projects and now feeling comfortable with my skills, just want to get advices and make friends with other Django developers.
/r/django
https://redd.it/1f38mbg
I have work on couple of Django projects and now feeling comfortable with my skills, just want to get advices and make friends with other Django developers.
/r/django
https://redd.it/1f38mbg
Reddit
From the django community on Reddit
Explore this post and more from the django community
Broken Pipe Error using SQLAlchemy for Redshift connection
I am running a rather simple Flask App with the goal of displaying Redshift database tables to users of the App. The App User model is also stored as a database table in Redshift with usernames, id's etc. (not much security is needed for this so it's fine).
The app is deployed in a Docker container in [AWS ECS](https://aws.amazon.com/ecs/).
**The problem:**
Upon first deployment of the App everything works fine (login, accessing all routes, viewing the tables etc.). When i log out of the App with my user and close the browser and then try to login again a couple of hours later I get the following Error in my logs:
[2024-08-27 09:43:02 UTC]: LOG: Login attempt for user: user01
[2024-08-27 09:43:02 UTC]: LOG: Querying database for user01: user01/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/default.py:736: UserWarning: DB-API extension cursor.connection used
cursor.execute(statement, parameters)
[2024-08-27 09:43:02 UTC]: LOG: Error querying database for user user01: (redshift_connector.error.InterfaceError) BrokenPipe: server socket closed. Please check that client side networking configurations such as Proxies, firewalls, VPN, etc. are not affecting your network connection.
(Background on this error at: https://sqlalche.me/e/14/rvf5)
[2024-08-27 09:43:02 UTC]: SQLAlchemyError occurred:
/r/flask
https://redd.it/1f2f753
I am running a rather simple Flask App with the goal of displaying Redshift database tables to users of the App. The App User model is also stored as a database table in Redshift with usernames, id's etc. (not much security is needed for this so it's fine).
The app is deployed in a Docker container in [AWS ECS](https://aws.amazon.com/ecs/).
**The problem:**
Upon first deployment of the App everything works fine (login, accessing all routes, viewing the tables etc.). When i log out of the App with my user and close the browser and then try to login again a couple of hours later I get the following Error in my logs:
[2024-08-27 09:43:02 UTC]: LOG: Login attempt for user: user01
[2024-08-27 09:43:02 UTC]: LOG: Querying database for user01: user01/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/default.py:736: UserWarning: DB-API extension cursor.connection used
cursor.execute(statement, parameters)
[2024-08-27 09:43:02 UTC]: LOG: Error querying database for user user01: (redshift_connector.error.InterfaceError) BrokenPipe: server socket closed. Please check that client side networking configurations such as Proxies, firewalls, VPN, etc. are not affecting your network connection.
(Background on this error at: https://sqlalche.me/e/14/rvf5)
[2024-08-27 09:43:02 UTC]: SQLAlchemyError occurred:
/r/flask
https://redd.it/1f2f753
Amazon
Amazon ECS
Amazon Elastic Container Service (Amazon ECS) provides a fully managed container service solution that’s easy to use, scalable, secure, and reliable.
Could you host DjangoCon Europe 2026? Call for organizers
https://www.djangoproject.com/weblog/2024/aug/28/could-you-host-djangocon-europe-2026-cfp/
/r/django
https://redd.it/1f3cy8l
https://www.djangoproject.com/weblog/2024/aug/28/could-you-host-djangocon-europe-2026-cfp/
/r/django
https://redd.it/1f3cy8l
Django Project
Could you host DjangoCon Europe 2026? Call for organizers
Posted by Thibaud Colas & DjangoCon Europe Support working group on August 28, 2024
problem routing the urls for my django ninja api
from .models import Order, OrderItem
from ninja import Router,NinjaAPI
from django.shortcuts import getobjector404
from ninja import Schema
from products.models import Product
api = NinjaAPI()
router = Router()
class OrderSchema(Schema):
id: int
userid: int
products: listint
totalprice: int
shippingaddress: str
createdat: str
updatedat: str
ordernumber: str
class OrderCreateSchema(Schema):
products:list[int]
totalprice:int
status:str
# list
router.get("/orders/", response=listOrderSchema)
def listorders(request):
order = Order.objects.all()
return order
@router.get("/orders/{orderid}/", response=OrderSchema)
def getorder(request, orderid:int):
/r/djangolearning
https://redd.it/1f2o6hc
from .models import Order, OrderItem
from ninja import Router,NinjaAPI
from django.shortcuts import getobjector404
from ninja import Schema
from products.models import Product
api = NinjaAPI()
router = Router()
class OrderSchema(Schema):
id: int
userid: int
products: listint
totalprice: int
shippingaddress: str
createdat: str
updatedat: str
ordernumber: str
class OrderCreateSchema(Schema):
products:list[int]
totalprice:int
status:str
# list
router.get("/orders/", response=listOrderSchema)
def listorders(request):
order = Order.objects.all()
return order
@router.get("/orders/{orderid}/", response=OrderSchema)
def getorder(request, orderid:int):
/r/djangolearning
https://redd.it/1f2o6hc
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
Thursday Daily Thread: Python Careers, Courses, and Furthering Education!
# Weekly Thread: Professional Use, Jobs, and Education 🏢
Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.
---
## How it Works:
1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.
---
## Guidelines:
- This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
- Keep discussions relevant to Python in the professional and educational context.
---
## Example Topics:
1. Career Paths: What kinds of roles are out there for Python developers?
2. Certifications: Are Python certifications worth it?
3. Course Recommendations: Any good advanced Python courses to recommend?
4. Workplace Tools: What Python libraries are indispensable in your professional work?
5. Interview Tips: What types of Python questions are commonly asked in interviews?
---
Let's help each other grow in our careers and education. Happy discussing! 🌟
/r/Python
https://redd.it/1f3ojlk
# Weekly Thread: Professional Use, Jobs, and Education 🏢
Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.
---
## How it Works:
1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.
---
## Guidelines:
- This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
- Keep discussions relevant to Python in the professional and educational context.
---
## Example Topics:
1. Career Paths: What kinds of roles are out there for Python developers?
2. Certifications: Are Python certifications worth it?
3. Course Recommendations: Any good advanced Python courses to recommend?
4. Workplace Tools: What Python libraries are indispensable in your professional work?
5. Interview Tips: What types of Python questions are commonly asked in interviews?
---
Let's help each other grow in our careers and education. Happy discussing! 🌟
/r/Python
https://redd.it/1f3ojlk
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Documentation difficult to navigate
I find Django documentation VERY annoying to navigate. Everything seems to be explained "by example" and actual reference overviews are hard to find. I feel like the documentation reads like one long tutorial on everything that Django has, but it leaves out many details that I would want to know, as I really don't like much "magic" happening in my code and the Django framework itself already introduces enough of that.
For example, the IntegerChoices class of Django models: I can't find it through the search bar, it is NOT in the General Index, but it is mentioned in the examples in the IntegerFields documentation under enumeration types. How would I have been able to find this if I encountered this class and wanted to look it up? Visit every possible related page and ctrl+F?
I just want to see for every class an overview of its member functions, what goes in, what comes out and which type everything is supposed to be in an exact, unambiguous way, like most other documentation of anything else ever. I don't want to read a book when I quickly want to find something...
Am I the only one annoyed
/r/django
https://redd.it/1f39njx
I find Django documentation VERY annoying to navigate. Everything seems to be explained "by example" and actual reference overviews are hard to find. I feel like the documentation reads like one long tutorial on everything that Django has, but it leaves out many details that I would want to know, as I really don't like much "magic" happening in my code and the Django framework itself already introduces enough of that.
For example, the IntegerChoices class of Django models: I can't find it through the search bar, it is NOT in the General Index, but it is mentioned in the examples in the IntegerFields documentation under enumeration types. How would I have been able to find this if I encountered this class and wanted to look it up? Visit every possible related page and ctrl+F?
I just want to see for every class an overview of its member functions, what goes in, what comes out and which type everything is supposed to be in an exact, unambiguous way, like most other documentation of anything else ever. I don't want to read a book when I quickly want to find something...
Am I the only one annoyed
/r/django
https://redd.it/1f39njx
Reddit
From the django community on Reddit
Explore this post and more from the django community
Anaconda Blues anyone else?
Despite the post here from 4 years ago, looks like Anaconda is going shopping for revenue from unsuspecting companies. We are a non profit that happens to have various solutions that leverage anaconda. Wondering if anyone has been through this and what their results were?
/r/Python
https://redd.it/1f3mfsk
Despite the post here from 4 years ago, looks like Anaconda is going shopping for revenue from unsuspecting companies. We are a non profit that happens to have various solutions that leverage anaconda. Wondering if anyone has been through this and what their results were?
/r/Python
https://redd.it/1f3mfsk
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Python Zen and implications
I was encouraged to reconsider my understanding the true implications of some of the Python Zen design principles, and started questioning my beliefs.
In particular "
Is this really it? Has anyone a good coding example or pattern that shows when explicit vs. implicit is actually relevant?
(It feels that like most of the cheap Zen quotes that are online, in which the actual meaning is created "at runtime" by the reader, leaving a lot of room for contradictory interpretations)
/r/Python
https://redd.it/1f3pbet
I was encouraged to reconsider my understanding the true implications of some of the Python Zen design principles, and started questioning my beliefs.
In particular "
Explicit is better than implicit". Pretty much all the examples are dead-trivial, like avoid "import *" and name your functions "read_something" instead of just "read".Is this really it? Has anyone a good coding example or pattern that shows when explicit vs. implicit is actually relevant?
(It feels that like most of the cheap Zen quotes that are online, in which the actual meaning is created "at runtime" by the reader, leaving a lot of room for contradictory interpretations)
/r/Python
https://redd.it/1f3pbet
Python Enhancement Proposals (PEPs)
PEP 20 – The Zen of Python | peps.python.org
Long time Pythoneer Tim Peters succinctly channels the BDFL’s guiding principles for Python’s design into 20 aphorisms, only 19 of which have been written down.