Hiding or showing fields based on a radio button click
I have a Django project I'm working on. I'm pretty new to Django, and even more so to CSS, HTML, HTMX. We are using Django-tweaks (which I think contains htmx?) and generating web pages for our project. I have a form where if you click on a radio button called risk\_area, it will hide or show two other fields. Those fields are called email and whatsapp. For all of my efforts, trying javascript, jquery, etc, it doesn't work. It runs the function showhide() (bottom of html file in script tags) on page load. It doesn't run it when I click on the radio buttons.
So my first question is.. using Django, htmx, tweaks, what is the cleanest solution to doing this? I could do views/forms approach to try to hide show the two fields, but this seems overkill when you just want to adjust two fields hiding or showing them. The fields are visible from the get go.
My 2nd question, assuming this is the way to go is why doesn't this javascript work?
`<script>`
`window.onload = function () {`
`function showHideEmailWhatsapp() {`
`var riskarea =
/r/djangolearning
https://redd.it/10c6vjw
I have a Django project I'm working on. I'm pretty new to Django, and even more so to CSS, HTML, HTMX. We are using Django-tweaks (which I think contains htmx?) and generating web pages for our project. I have a form where if you click on a radio button called risk\_area, it will hide or show two other fields. Those fields are called email and whatsapp. For all of my efforts, trying javascript, jquery, etc, it doesn't work. It runs the function showhide() (bottom of html file in script tags) on page load. It doesn't run it when I click on the radio buttons.
So my first question is.. using Django, htmx, tweaks, what is the cleanest solution to doing this? I could do views/forms approach to try to hide show the two fields, but this seems overkill when you just want to adjust two fields hiding or showing them. The fields are visible from the get go.
My 2nd question, assuming this is the way to go is why doesn't this javascript work?
`<script>`
`window.onload = function () {`
`function showHideEmailWhatsapp() {`
`var riskarea =
/r/djangolearning
https://redd.it/10c6vjw
reddit
Hiding or showing fields based on a radio button click
I have a Django project I'm working on. I'm pretty new to Django, and even more so to CSS, HTML, HTMX. We are using Django-tweaks (which I think...
Djoser customization
I am using djoser for user registration but I want that some user will bypass the email verification
/r/djangolearning
https://redd.it/10bfzs7
I am using djoser for user registration but I want that some user will bypass the email verification
/r/djangolearning
https://redd.it/10bfzs7
reddit
Djoser customization
I am using djoser for user registration but I want that some user will bypass the email verification
Separate into spaces for users
Hi everyone, I am building a CRM using Django and deploying on Heroku. I am trying to understand what is the best practice for such a project. Basically I have customers and I create a space for them in which they can have users. Should I deploy a new project for each space that has its own webserver/database etc or should I have only one server with one database and just add a field "space" to the models? Seems a bit more dangerous in terms of security to me. And in this case should I have a separate table for each model per space or use only one table for each model and add a field as mentioned above?
/r/django
https://redd.it/10crpk6
Hi everyone, I am building a CRM using Django and deploying on Heroku. I am trying to understand what is the best practice for such a project. Basically I have customers and I create a space for them in which they can have users. Should I deploy a new project for each space that has its own webserver/database etc or should I have only one server with one database and just add a field "space" to the models? Seems a bit more dangerous in terms of security to me. And in this case should I have a separate table for each model per space or use only one table for each model and add a field as mentioned above?
/r/django
https://redd.it/10crpk6
reddit
Separate into spaces for users
Hi everyone, I am building a CRM using Django and deploying on Heroku. I am trying to understand what is the best practice for such a project....
Custom User Model - Login with email address and password for production use
How can I ensure that users can log in to the website with just an email address and password without an additional package?
For this I have already created a Custom User Model and changed AUTH_USER_MODEL:
models.py:
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils.translation import gettextlazy as
class User(AbstractUser):
username = None
firstname = None
lastname = None
name = models.CharField(maxlength=150, blank=True)
email = models.EmailField(("email address"), unique=True)
USERNAMEFIELD = "email"
REQUIREDFIELDS =
settings.py:
AUTHUSERMODEL = "users.User"
There is a "Customizing authentication in Django" page on the Django website. There is an example at the end. But unfortunately there is also the following:
"not intended to be copied directly into projects for
/r/django
https://redd.it/10csae9
How can I ensure that users can log in to the website with just an email address and password without an additional package?
For this I have already created a Custom User Model and changed AUTH_USER_MODEL:
models.py:
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils.translation import gettextlazy as
class User(AbstractUser):
username = None
firstname = None
lastname = None
name = models.CharField(maxlength=150, blank=True)
email = models.EmailField(("email address"), unique=True)
USERNAMEFIELD = "email"
REQUIREDFIELDS =
settings.py:
AUTHUSERMODEL = "users.User"
There is a "Customizing authentication in Django" page on the Django website. There is an example at the end. But unfortunately there is also the following:
"not intended to be copied directly into projects for
/r/django
https://redd.it/10csae9
reddit
Custom User Model - Login with email address and password for...
How can I ensure that users can log in to the website with just an email address and password without an additional package? For this I have...
How to update data on a page without hitting API repeatedly?
Hi there, I have a project up and running which merges multiple pdf files into a single pdf file. The backend is in Django REST and Frontend is in Angular.
I have a merge log page showing all the ongoing or finished merge processes. It also has a percent complete column. Which only updates when the API is hit again.
I want to update the value of percent complete, without repeatedly hitting the API.
If I hit the same API at an interval of 1 second it will always show the latest data.
But is there any other way to achieve this?
/r/django
https://redd.it/10chrgo
Hi there, I have a project up and running which merges multiple pdf files into a single pdf file. The backend is in Django REST and Frontend is in Angular.
I have a merge log page showing all the ongoing or finished merge processes. It also has a percent complete column. Which only updates when the API is hit again.
I want to update the value of percent complete, without repeatedly hitting the API.
If I hit the same API at an interval of 1 second it will always show the latest data.
But is there any other way to achieve this?
/r/django
https://redd.it/10chrgo
reddit
How to update data on a page without hitting API repeatedly?
Hi there, I have a project up and running which merges multiple pdf files into a single pdf file. The backend is in Django REST and Frontend is in...
how to update an object's foreign key while representing it with a custom serializer
Hey there! I'm have a couple of models that look like this
class Project(models.Model):
...
class Task(models.Model):
project = models.ForeignKey(Project, default=None, null=True, blank=True, ondelete=models.DONOTHING)
and a serializer that looks like this:
class TaskSerializer(serializers.ModelSerializer):
project = ProjectSerializer()
fields = 'id', 'name', 'project'
I want to be able to change a task's project with a PUT or PATCH request. However, when I send a request with data like
I guess I can work around this by overriding methods in the viewset, but wanted to ask here in case there's a cleaner way to do this
/r/django
https://redd.it/10cwuvl
Hey there! I'm have a couple of models that look like this
class Project(models.Model):
...
class Task(models.Model):
project = models.ForeignKey(Project, default=None, null=True, blank=True, ondelete=models.DONOTHING)
and a serializer that looks like this:
class TaskSerializer(serializers.ModelSerializer):
project = ProjectSerializer()
fields = 'id', 'name', 'project'
I want to be able to change a task's project with a PUT or PATCH request. However, when I send a request with data like
{"project":2} I get a 200 response but the project doesn't change. using project_id instead doesn't work either. I know I could use PrimaryKeyRelatedField but in this case I really need project to use it's custom serializer.I guess I can work around this by overriding methods in the viewset, but wanted to ask here in case there's a cleaner way to do this
/r/django
https://redd.it/10cwuvl
reddit
how to update an object's foreign key while representing it with a...
Hey there! I'm have a couple of models that look like this class Project(models.Model): ... class Task(models.Model): ...
[SocketIO, CORS] Using flask_socketio and fixing the CORS issue
I am building a webrtc web relay app that will be hosted on flask app using SocketIO module.
I have my code but I keep on hitting roadblocks with the CORS issue.
I am running a react webapp on port 3000 and the flask app runs on port 5000 with the socketio implementation ruinning on the flask app on port 9000.
My current error is: `code 400, message Bad request syntax ('\x16\x03\x01\x02\x00\x01\x00\x01ü\x03\x03\x06ØÏÀü;Ì$\x03¬íÌNDZ')` on the server.
On the client (personal laptop) my error is: `Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at` [`https://192.168.0.180:9000/socket.io/?EIO=4&transport=polling&t=OMtIa2H`](https://192.168.0.180:9000/socket.io/?EIO=4&transport=polling&t=OMtIa2H)`. (Reason: CORS request did not succeed). Status code: (null).`
I created a self signed certificate using cygwin. My breakpoints are never hit during debug and when i console.log the socketio object in firefox its connected is false.
What is the issue?
Python code:
from flask import Flask, request
from flask_socketio import SocketIO, emit, join_room
from flask_cors import CORS
app = Flask(__name__)
app.secret_key = 'random secret key!'
app.debug = True
socketio = SocketIO(app, cors_allowed_origins="*")
CORS(app)
/r/flask
https://redd.it/10cvf7g
I am building a webrtc web relay app that will be hosted on flask app using SocketIO module.
I have my code but I keep on hitting roadblocks with the CORS issue.
I am running a react webapp on port 3000 and the flask app runs on port 5000 with the socketio implementation ruinning on the flask app on port 9000.
My current error is: `code 400, message Bad request syntax ('\x16\x03\x01\x02\x00\x01\x00\x01ü\x03\x03\x06ØÏÀü;Ì$\x03¬íÌNDZ')` on the server.
On the client (personal laptop) my error is: `Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at` [`https://192.168.0.180:9000/socket.io/?EIO=4&transport=polling&t=OMtIa2H`](https://192.168.0.180:9000/socket.io/?EIO=4&transport=polling&t=OMtIa2H)`. (Reason: CORS request did not succeed). Status code: (null).`
I created a self signed certificate using cygwin. My breakpoints are never hit during debug and when i console.log the socketio object in firefox its connected is false.
What is the issue?
Python code:
from flask import Flask, request
from flask_socketio import SocketIO, emit, join_room
from flask_cors import CORS
app = Flask(__name__)
app.secret_key = 'random secret key!'
app.debug = True
socketio = SocketIO(app, cors_allowed_origins="*")
CORS(app)
/r/flask
https://redd.it/10cvf7g
reddit
[SocketIO, CORS] Using flask_socketio and fixing the CORS issue
I am building a webrtc web relay app that will be hosted on flask app using SocketIO module. I have my code but I keep on hitting roadblocks with...
[SocketIO, CORS] Using flask_socketio and fixing the CORS issue
I am building a webrtc web relay app that will be hosted on flask app using SocketIO module.
I have my code but I keep on hitting roadblocks with the CORS issue.
I am running a react webapp on port 3000 and the flask app runs on port 5000 with the socketio implementation ruinning on the flask app on port 9000.
My current error is: `code 400, message Bad request syntax ('\x16\x03\x01\x02\x00\x01\x00\x01ü\x03\x03\x06ØÏÀü;Ì$\x03¬íÌNDZ')` on the server.
On the client (personal laptop) my error is: `Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at` [`https://192.168.0.180:9000/socket.io/?EIO=4&transport=polling&t=OMtIa2H`](https://192.168.0.180:9000/socket.io/?EIO=4&transport=polling&t=OMtIa2H)`. (Reason: CORS request did not succeed). Status code: (null).`
I created a self signed certificate using cygwin. My breakpoints are never hit during debug and when i console.log the socketio object in firefox its connected is false.
What is the issue?
Python code:
from flask import Flask, request
from flask_socketio import SocketIO, emit, join_room
from flask_cors import CORS
app = Flask(__name__)
app.secret_key = 'random secret key!'
app.debug = True
socketio = SocketIO(app, cors_allowed_origins="*")
CORS(app)
/r/flask
https://redd.it/10cvf7g
I am building a webrtc web relay app that will be hosted on flask app using SocketIO module.
I have my code but I keep on hitting roadblocks with the CORS issue.
I am running a react webapp on port 3000 and the flask app runs on port 5000 with the socketio implementation ruinning on the flask app on port 9000.
My current error is: `code 400, message Bad request syntax ('\x16\x03\x01\x02\x00\x01\x00\x01ü\x03\x03\x06ØÏÀü;Ì$\x03¬íÌNDZ')` on the server.
On the client (personal laptop) my error is: `Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at` [`https://192.168.0.180:9000/socket.io/?EIO=4&transport=polling&t=OMtIa2H`](https://192.168.0.180:9000/socket.io/?EIO=4&transport=polling&t=OMtIa2H)`. (Reason: CORS request did not succeed). Status code: (null).`
I created a self signed certificate using cygwin. My breakpoints are never hit during debug and when i console.log the socketio object in firefox its connected is false.
What is the issue?
Python code:
from flask import Flask, request
from flask_socketio import SocketIO, emit, join_room
from flask_cors import CORS
app = Flask(__name__)
app.secret_key = 'random secret key!'
app.debug = True
socketio = SocketIO(app, cors_allowed_origins="*")
CORS(app)
/r/flask
https://redd.it/10cvf7g
reddit
[SocketIO, CORS] Using flask_socketio and fixing the CORS issue
I am building a webrtc web relay app that will be hosted on flask app using SocketIO module. I have my code but I keep on hitting roadblocks with...
9 IPython Magic Commands That Make Your Programming Easier
https://medium.com/techtofreedom/9-ipython-magic-commands-that-make-your-programming-easier-67d35d74c0e6
/r/flask
https://redd.it/10cwq11
https://medium.com/techtofreedom/9-ipython-magic-commands-that-make-your-programming-easier-67d35d74c0e6
/r/flask
https://redd.it/10cwq11
Medium
9 IPython Magic Commands That Make Your Programming Easier
Beyond the normal Python
My first many to many join, why isn't membership being populated?
from flask import Flask
from flasksqlalchemy import SQLAlchemy
app = Flask(name)
app.config['SQLALCHEMYDATABASEURI'] = 'sqlite:///project.db'
db = SQLAlchemy(app)
membership = db.Table('membership',
db.Column('personid', db.Integer, db.ForeignKey('Person.id')),
db.Column('organisationid', db.Integer, db.ForeignKey('Organisation.id'))
)
class Person(db.Model):
tablename = 'Person'
id = db.Column(db.Integer, primarykey=True)
name = db.Column(db.String(255))
password = db.Column(db.String(255))
memberof = db.relationship('Organisation', secondary=membership, backref='members', viewonly=True)
class Organisation(db.Model):
tablename = 'Organisation'
id = db.Column(db.Integer, primarykey=True)
name = db.Column(db.String(255))
people = db.relationship('Person', secondary=membership, backref='organisation', viewonly=True)
/r/flask
https://redd.it/10bzpcl
from flask import Flask
from flasksqlalchemy import SQLAlchemy
app = Flask(name)
app.config['SQLALCHEMYDATABASEURI'] = 'sqlite:///project.db'
db = SQLAlchemy(app)
membership = db.Table('membership',
db.Column('personid', db.Integer, db.ForeignKey('Person.id')),
db.Column('organisationid', db.Integer, db.ForeignKey('Organisation.id'))
)
class Person(db.Model):
tablename = 'Person'
id = db.Column(db.Integer, primarykey=True)
name = db.Column(db.String(255))
password = db.Column(db.String(255))
memberof = db.relationship('Organisation', secondary=membership, backref='members', viewonly=True)
class Organisation(db.Model):
tablename = 'Organisation'
id = db.Column(db.Integer, primarykey=True)
name = db.Column(db.String(255))
people = db.relationship('Person', secondary=membership, backref='organisation', viewonly=True)
/r/flask
https://redd.it/10bzpcl
reddit
My first many to many join, why isn't membership being populated?
from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] =...
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/10cz8rg
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/10cz8rg
reddit
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 to improve Python packaging, or why fourteen tools are at least twelve too many
https://chriswarrick.com/blog/2023/01/15/how-to-improve-python-packaging/
/r/Python
https://redd.it/10cnx5i
https://chriswarrick.com/blog/2023/01/15/how-to-improve-python-packaging/
/r/Python
https://redd.it/10cnx5i
Chris Warrick
How to improve Python packaging, or why fourteen tools are at least tw
A journey to the world of Python packaging, a visit to the competition, a hopeful look at the future, and highlights from a disappointing discussion.
Best Python Books for beginners to advanced to read
https://codingvidya.com/best-python-books/
/r/Python
https://redd.it/10d1prx
https://codingvidya.com/best-python-books/
/r/Python
https://redd.it/10d1prx
Codingvidya
11 Best Python Books for beginners to advanced to read in 2022 -
best Python books, you can learn Python programming as it has a direct and simple language layout. learners from all levels deepen skills
Supply Chain Attack Using Identical PyPI Packages, “colorslib”, “httpslib”, and “libhttps” | FortiGuard Labs
https://www.fortinet.com/blog/threat-research/supply-chain-attack-using-identical-pypi-packages-colorslib-httpslib-libhttps
/r/Python
https://redd.it/10cm2yo
https://www.fortinet.com/blog/threat-research/supply-chain-attack-using-identical-pypi-packages-colorslib-httpslib-libhttps
/r/Python
https://redd.it/10cm2yo
Fortinet Blog
Supply Chain Attack Using Identical PyPI Packages, “colorslib”, “httpslib”, and “libhttps”
The FortiGuard Labs team discovered an attack embedded in three PyPI packages called ‘colorslib’, ‘httpslib’, and “libhttps”. Read our blog to learn more.…
New python graphics library !
Hi everyone.
I would like to share with you my own python graphic library.
The library is called Raylib-Python-Ctypes (also known as raypyc). Raypyc is a binding for python of the great c graphics library Raylib.
What can Raypyc do?
Basically, every thing that Raylib can do, like: open window, draw simple shapes, drawing textures, drawing models, drawing text (with an optional way of loading and using fonts), using shaders and much more!!!
Why should you use Raypyc?
Well, Raypyc was design to be programmer friendly and beginner, friendly. also Raypyc is really simple, no fancy game engines stuff only basic needs for the programmer.
(And it’s 100% open source)
Why did I make Raypyc?
In general, Raypyc was a school project of mine, but as I saw, it’s potential I started to make it more like a professional graphic library.
Library source code and examples: https://github.com/sDos280/raylib-python-ctypes
/r/Python
https://redd.it/10cos5v
Hi everyone.
I would like to share with you my own python graphic library.
The library is called Raylib-Python-Ctypes (also known as raypyc). Raypyc is a binding for python of the great c graphics library Raylib.
What can Raypyc do?
Basically, every thing that Raylib can do, like: open window, draw simple shapes, drawing textures, drawing models, drawing text (with an optional way of loading and using fonts), using shaders and much more!!!
Why should you use Raypyc?
Well, Raypyc was design to be programmer friendly and beginner, friendly. also Raypyc is really simple, no fancy game engines stuff only basic needs for the programmer.
(And it’s 100% open source)
Why did I make Raypyc?
In general, Raypyc was a school project of mine, but as I saw, it’s potential I started to make it more like a professional graphic library.
Library source code and examples: https://github.com/sDos280/raylib-python-ctypes
/r/Python
https://redd.it/10cos5v
raylib
raylib is a simple and easy-to-use library to enjoy videogames programming.
Django-react google ads api integration
Hello everyone,
I'have been trying to connect my drf-react application with google ads api. I tried to use django allauth and dj-rest-auth for this but was unable to do so. It would be a great help if anyone can provide me with some resources.
/r/django
https://redd.it/10d9zsn
Hello everyone,
I'have been trying to connect my drf-react application with google ads api. I tried to use django allauth and dj-rest-auth for this but was unable to do so. It would be a great help if anyone can provide me with some resources.
/r/django
https://redd.it/10d9zsn
reddit
Django-react google ads api integration
Hello everyone, I'have been trying to connect my drf-react application with google ads api. I tried to use django allauth and dj-rest-auth for...
Why response time with postgres is 15x higher than with sqlite?
Simple get request (django + django-rest-framework) with sqlite3 database takes 2ms. Using postgres, response time extends to over 30ms. Why is that, how to make postgres faster?
​
Settings with sqlite:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASEDIR / 'db.sqlite3',
}
}
https://preview.redd.it/yhrvlevoebca1.png?width=1228&format=png&auto=webp&v=enabled&s=a572f9c9b2f26e3e39de276447a3179026c43150
Settings with postgres:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresqlpsycopg2',
'NAME': 'drf-test',
'USER': 'postgres',
'PASSWORD': 'postgres',
'HOST': 'localhost',
'PORT': '5432',
}
}
​
https://preview.redd.it/mdg0q37tebca1.png?width=1442&format=png&auto=webp&v=enabled&s=950e1bd53e70a7f3f064ee266fa215c6aa700adc
class Product(models.Model):
/r/django
https://redd.it/10d2d5z
Simple get request (django + django-rest-framework) with sqlite3 database takes 2ms. Using postgres, response time extends to over 30ms. Why is that, how to make postgres faster?
​
Settings with sqlite:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASEDIR / 'db.sqlite3',
}
}
https://preview.redd.it/yhrvlevoebca1.png?width=1228&format=png&auto=webp&v=enabled&s=a572f9c9b2f26e3e39de276447a3179026c43150
Settings with postgres:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresqlpsycopg2',
'NAME': 'drf-test',
'USER': 'postgres',
'PASSWORD': 'postgres',
'HOST': 'localhost',
'PORT': '5432',
}
}
​
https://preview.redd.it/mdg0q37tebca1.png?width=1442&format=png&auto=webp&v=enabled&s=950e1bd53e70a7f3f064ee266fa215c6aa700adc
class Product(models.Model):
/r/django
https://redd.it/10d2d5z
Are Django 3 tutorials viable today?
I have found 2 YouTube tutorials which are simple to follow, one is for Django 3.0, and one is 4 years old, so I want to know if they are viable today before I figure it out myself when it is too late.
/r/django
https://redd.it/10d7m4y
I have found 2 YouTube tutorials which are simple to follow, one is for Django 3.0, and one is 4 years old, so I want to know if they are viable today before I figure it out myself when it is too late.
/r/django
https://redd.it/10d7m4y
reddit
Are Django 3 tutorials viable today?
I have found 2 YouTube tutorials which are simple to follow, one is for Django 3.0, and one is 4 years old, so I want to know if they are viable...
NiceGUI: Let any browser be the frontend for your Python code
We are thrilled to share that NiceGUI, our open-source library for building web-based user interfaces, continues to thrive. With NiceGUI, you can focus on writing Python code while the web development details are handled behind the scenes. This makes it ideal for a wide range of projects including short scripts, dashboards, robotics projects, IoT solutions, smart home automation, and machine learning.
Of course there are valid use cases for splitting frontend and backend technologies. NiceGUI is for those who don’t want to leave the Python ecosystem and like to reap the benefits of having all code in one place. There are other options like Streamlit, Dash, Anvil, JustPy, and Pynecone. But we initially created NiceGUI to easily handle the state of external hardware like LEDs, motors, and cameras. Additionally, we wanted to offer a gentle learning curve while still providing the ability to go all the way down to HTML, CSS, and JavaScript if needed.
NiceGUI runs on top of FastAPI which allows you to add authentication, routing, OpenAPI specs, and other backend functionality to your projects. The frontend is implemented using Vue, Quasar, and Tailwind, but you don’t need to be familiar with these technologies to create beautiful user interfaces. NiceGUI
/r/Python
https://redd.it/10d6ugv
We are thrilled to share that NiceGUI, our open-source library for building web-based user interfaces, continues to thrive. With NiceGUI, you can focus on writing Python code while the web development details are handled behind the scenes. This makes it ideal for a wide range of projects including short scripts, dashboards, robotics projects, IoT solutions, smart home automation, and machine learning.
Of course there are valid use cases for splitting frontend and backend technologies. NiceGUI is for those who don’t want to leave the Python ecosystem and like to reap the benefits of having all code in one place. There are other options like Streamlit, Dash, Anvil, JustPy, and Pynecone. But we initially created NiceGUI to easily handle the state of external hardware like LEDs, motors, and cameras. Additionally, we wanted to offer a gentle learning curve while still providing the ability to go all the way down to HTML, CSS, and JavaScript if needed.
NiceGUI runs on top of FastAPI which allows you to add authentication, routing, OpenAPI specs, and other backend functionality to your projects. The frontend is implemented using Vue, Quasar, and Tailwind, but you don’t need to be familiar with these technologies to create beautiful user interfaces. NiceGUI
/r/Python
https://redd.it/10d6ugv
streamlit.io
Streamlit • A faster way to build and share data apps
Streamlit is an open-source Python framework for data scientists and AI/ML engineers to deliver interactive data apps – in only a few lines of code.
How Python 3.11 became so fast!!!
With Python 3.11, it’s making quite some noise in the Python circles. It has become almost 2x times faster than its predecessor. But what's new in this version of Python?
New Data structure: Because of the removal of the exception stack huge memory is being saved which is again used by the cache to allocate to the newly created python object frame.
Specialized adaptive Interpreter:
Each instruction is one of the two states.
General, with a warm-up counter: When the counter reaches zero, the instruction is specialized. (to do general lookup)
Specialized, with a miss counter: When the counter reaches zero, the instruction is de-optimized. (to lookup particular values or types of values)
Specialized bytecode: Specialization is just how the memory is read (the reading order) when a particular instruction runs. The same stuff can be accessed in multiple ways, specialization is just optimizing the memory read for that particular instruction.
Read the full article here: https://medium.com/aiguys/how-python-3-11-is-becoming-faster-b2455c1bc555
​
https://preview.redd.it/lzode0q58eca1.png?width=828&format=png&auto=webp&v=enabled&s=46f01d18edf19d961b9fa958e832f3302716533e
/r/Python
https://redd.it/10dcjxx
With Python 3.11, it’s making quite some noise in the Python circles. It has become almost 2x times faster than its predecessor. But what's new in this version of Python?
New Data structure: Because of the removal of the exception stack huge memory is being saved which is again used by the cache to allocate to the newly created python object frame.
Specialized adaptive Interpreter:
Each instruction is one of the two states.
General, with a warm-up counter: When the counter reaches zero, the instruction is specialized. (to do general lookup)
Specialized, with a miss counter: When the counter reaches zero, the instruction is de-optimized. (to lookup particular values or types of values)
Specialized bytecode: Specialization is just how the memory is read (the reading order) when a particular instruction runs. The same stuff can be accessed in multiple ways, specialization is just optimizing the memory read for that particular instruction.
Read the full article here: https://medium.com/aiguys/how-python-3-11-is-becoming-faster-b2455c1bc555
​
https://preview.redd.it/lzode0q58eca1.png?width=828&format=png&auto=webp&v=enabled&s=46f01d18edf19d961b9fa958e832f3302716533e
/r/Python
https://redd.it/10dcjxx
Medium
How Python 3.11 is becoming faster
Python is a great language but everyone already knows that. Now with Python 3.11, it’s making quite some noise in the Python circles. It…